Skip to content

Commit 87f0f93

Browse files
committed
References to parameter accessors do not have ab elidable prefix.
Reason: The ParamAccessor flag will be reset later in Mixin. We do not want to rerite the references to a trait parameter accessor then, so it's better to generate all references with a `this.` prefix from the start.
1 parent 44095fb commit 87f0f93

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
302302
true
303303
case pre: ThisType =>
304304
pre.cls.isStaticOwner ||
305-
tp.symbol.is(ParamOrAccessor) && ctx.owner.enclosingClass == pre.cls
305+
tp.symbol.is(ParamOrAccessor) && !pre.cls.is(Trait) && ctx.owner.enclosingClass == pre.cls
306306
// was ctx.owner.enclosingClass.derivesFrom(pre.cls) which was not tight enough
307307
// and was spuriously triggered in case inner class would inherit from outer one
308308
// eg anonymous TypeMap inside TypeMap.andThen

0 commit comments

Comments
 (0)