File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
compiler/src/dotty/tools/dotc/ast Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -467,8 +467,16 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
467467 else if (tp.symbol hasAnnotation defn.ScalaStaticAnnot )
468468 Ident (tp)
469469 else
470+ // Throw an error here if we detect a skolem to improve the error message in tests/neg/i8623.scala
471+ def checkNoSkolemInPrefix (pre : Type ): Unit = pre.dealias match
472+ case pre : SkolemType =>
473+ throw TypeError (em " cannot construct a tree referring to $tp because of skolem prefix $pre" )
474+ case pre : TermRef => checkNoSkolemInPrefix(pre.prefix)
475+ case _ =>
476+
470477 val pre = tp.prefix
471- if (pre.isSingleton) followOuterLinks(singleton(pre.dealias, needLoad)).select(tp)
478+ checkNoSkolemInPrefix(tp)
479+ if pre.isSingleton then followOuterLinks(singleton(pre.dealias, needLoad)).select(tp)
472480 else
473481 val res = Select (TypeTree (pre), tp)
474482 if needLoad && ! res.symbol.isStatic then
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