Skip to content

Commit d2cea4f

Browse files
committed
Make this prefixes of types always elidable
Without that change, a reference to an enclosing type gets always converted to a TypeTree. This undermines access checking for constructors, which is implemented in the next commit.
1 parent 0ee3281 commit d2cea4f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compiler/src/dotty/tools/dotc/ast/tpd.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
309309
case NoPrefix =>
310310
true
311311
case pre: ThisType =>
312+
tp.isType ||
312313
pre.cls.isStaticOwner ||
313314
tp.symbol.isParamOrAccessor && !pre.cls.is(Trait) && ctx.owner.enclosingClass == pre.cls
314315
// was ctx.owner.enclosingClass.derivesFrom(pre.cls) which was not tight enough

0 commit comments

Comments
 (0)