We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8eb442f commit c57143dCopy full SHA for c57143d
compiler/src/dotty/tools/dotc/ast/tpd.scala
@@ -407,7 +407,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
407
case pre: ThisType =>
408
tp.isType ||
409
pre.cls.isStaticOwner ||
410
- tp.symbol.isParamOrAccessor && !tp.symbol.owner.is(Trait) && ctx.owner.enclosingClass == pre.cls
+ tp.symbol.isParamOrAccessor && !pre.cls.is(Trait) && !tp.symbol.owner.is(Trait) && ctx.owner.enclosingClass == pre.cls
411
// was ctx.owner.enclosingClass.derivesFrom(pre.cls) which was not tight enough
412
// and was spuriously triggered in case inner class would inherit from outer one
413
// eg anonymous TypeMap inside TypeMap.andThen
0 commit comments