Skip to content

Commit 01a37ec

Browse files
committed
Keep the previous condition in preflixElidable
1 parent c35a700 commit 01a37ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: compiler/src/dotty/tools/dotc/ast/tpd.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
414414
case pre: ThisType =>
415415
tp.isType ||
416416
pre.cls.isStaticOwner ||
417-
tp.symbol.isParamOrAccessor && !tp.symbol.owner.is(Trait) && ctx.owner.enclosingClass == pre.cls
417+
tp.symbol.isParamOrAccessor && !pre.cls.is(Trait) && !tp.symbol.owner.is(Trait) && ctx.owner.enclosingClass == pre.cls
418418
// was ctx.owner.enclosingClass.derivesFrom(pre.cls) which was not tight enough
419419
// and was spuriously triggered in case inner class would inherit from outer one
420420
// eg anonymous TypeMap inside TypeMap.andThen

0 commit comments

Comments
 (0)