diff options
author | odersky <odersky@gmail.com> | 2017-04-11 17:32:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-11 17:32:27 +0200 |
commit | f13e3a43d227933ce644f2503f658ea436ea11b4 (patch) | |
tree | cfbb32705c038aab021d5f95267135a8a031490f /compiler | |
parent | 9917029becab32d56e786ac9309ee195737f6da0 (diff) | |
parent | 48c37927bd95f5e6bb9f71d02def7e2fef125202 (diff) | |
download | dotty-f13e3a43d227933ce644f2503f658ea436ea11b4.tar.gz dotty-f13e3a43d227933ce644f2503f658ea436ea11b4.tar.bz2 dotty-f13e3a43d227933ce644f2503f658ea436ea11b4.zip |
Merge pull request #2216 from dotty-staging/fix-2163
fix #2163: don't narrow liftedOwner if symbol is InSuperCall
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/src/dotty/tools/dotc/transform/LambdaLift.scala | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/compiler/src/dotty/tools/dotc/transform/LambdaLift.scala b/compiler/src/dotty/tools/dotc/transform/LambdaLift.scala index 7578b57f1..a729368d4 100644 --- a/compiler/src/dotty/tools/dotc/transform/LambdaLift.scala +++ b/compiler/src/dotty/tools/dotc/transform/LambdaLift.scala @@ -143,13 +143,17 @@ class LambdaLift extends MiniPhase with IdentityDenotTransformer { thisTransform /** Set `liftedOwner(sym)` to `owner` if `owner` is more deeply nested * than the previous value of `liftedowner(sym)`. */ - def narrowLiftedOwner(sym: Symbol, owner: Symbol)(implicit ctx: Context) = + def narrowLiftedOwner(sym: Symbol, owner: Symbol)(implicit ctx: Context): Unit = if (sym.maybeOwner.isTerm && owner.isProperlyContainedIn(liftedOwner(sym)) && owner != sym) { - ctx.log(i"narrow lifted $sym to $owner") - changedLiftedOwner = true - liftedOwner(sym) = owner + if (sym.is(InSuperCall) && owner.isProperlyContainedIn(sym.enclosingClass)) + narrowLiftedOwner(sym, sym.enclosingClass) + else { + ctx.log(i"narrow lifted $sym to $owner") + changedLiftedOwner = true + liftedOwner(sym) = owner + } } /** Mark symbol `sym` as being free in `enclosure`, unless `sym` is defined |