Skip to content

Commit

Permalink
Keep the previous condition in preflixElidable
Browse files Browse the repository at this point in the history
[Cherry-picked 01a37ec]
  • Loading branch information
szymon-rd authored and WojciechMazur committed Jun 23, 2024
1 parent 685d292 commit aa0a904
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/ast/tpd.scala
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
case pre: ThisType =>
tp.isType ||
pre.cls.isStaticOwner ||
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
// was ctx.owner.enclosingClass.derivesFrom(pre.cls) which was not tight enough
// and was spuriously triggered in case inner class would inherit from outer one
// eg anonymous TypeMap inside TypeMap.andThen
Expand Down

0 comments on commit aa0a904

Please sign in to comment.