diff options
author | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-05-13 14:11:02 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-05-13 14:11:02 +0200 |
commit | 929e8893522d1cbfdfbb7d2e7c6531d3435420ec (patch) | |
tree | 3c60e26a2413c476d80f45a58fc4bc973770798b /src/dotty/tools/dotc/transform/LambdaLift.scala | |
parent | 32a70042fc8a0338e093dba0424c98d25fb3a754 (diff) | |
download | dotty-929e8893522d1cbfdfbb7d2e7c6531d3435420ec.tar.gz dotty-929e8893522d1cbfdfbb7d2e7c6531d3435420ec.tar.bz2 dotty-929e8893522d1cbfdfbb7d2e7c6531d3435420ec.zip |
Compute enclosingClass and topLevelClass once in LambdaLift.liftLocals
Diffstat (limited to 'src/dotty/tools/dotc/transform/LambdaLift.scala')
-rw-r--r-- | src/dotty/tools/dotc/transform/LambdaLift.scala | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/transform/LambdaLift.scala b/src/dotty/tools/dotc/transform/LambdaLift.scala index c22167b99..42c6e85af 100644 --- a/src/dotty/tools/dotc/transform/LambdaLift.scala +++ b/src/dotty/tools/dotc/transform/LambdaLift.scala @@ -289,13 +289,15 @@ class LambdaLift extends MiniPhase with IdentityDenotTransformer { thisTransform for ((local, lOwner) <- liftedOwner) { val (newOwner, maybeStatic) = if (lOwner is Package) { + val encClass = local.enclosingClass + val topClass = local.topLevelClass // member of a static object - if (local.enclosingClass.isStatic && local.enclosingClass.isProperlyContainedIn(local.topLevelClass)) { + if (encClass.isStatic && encClass.isProperlyContainedIn(topClass)) { // though the second condition seems weird, it's not true for symbols which are defined in some // weird combinations of super calls. - (local.enclosingClass, EmptyFlags) + (encClass, EmptyFlags) } else - (local.topLevelClass, JavaStatic) + (topClass, JavaStatic) } else (lOwner, EmptyFlags) local.copySymDenotation( |