Skip to content

Commit c57143d

Browse files
szymon-rdWojciechMazur
authored andcommitted
Keep the previous condition in preflixElidable
[Cherry-picked 01a37ec]
1 parent 8eb442f commit c57143d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

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

0 commit comments

Comments
 (0)