File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
compiler/src/dotty/tools/dotc/ast Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -480,7 +480,15 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
480480 else if tp.symbol.hasAnnotation(defn.ScalaStaticAnnot ) then
481481 Ident (tp)
482482 else
483+ // Throw an error here if we detect a skolem to improve the error message in tests/neg/i8623.scala
484+ def checkNoSkolemInPrefix (pre : Type ): Unit = pre.dealias match
485+ case pre : SkolemType =>
486+ throw TypeError (em " cannot construct a tree referring to $tp because of skolem prefix $pre" )
487+ case pre : TermRef => checkNoSkolemInPrefix(pre.prefix)
488+ case _ =>
489+
483490 val pre = tp.prefix
491+ checkNoSkolemInPrefix(tp)
484492 if pre.isSingleton then followOuterLinks(singleton(pre.dealias, needLoad)).select(tp)
485493 else
486494 val res = Select (TypeTree (pre), tp)
Original file line number Diff line number Diff line change 44 | value pos is not a member of ?1.tasty.Tree.
55 | Extension methods were tried, but the search failed with:
66 |
7- | cannot construct a tree referring to skolem (?1 : QC)
7+ | cannot construct a tree referring to ?1.tasty.type because of skolem prefix (?1 : QC)
88 |
99 | where: ?1 is an unknown value of type QC
1010 |
You can’t perform that action at this time.
0 commit comments