diff options
author | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2016-05-27 13:18:52 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2016-05-27 14:14:33 +0200 |
commit | 3b0cb481e379ee07ce33d80a1bee5ff67c32eb40 (patch) | |
tree | 501779683a4a92010bdb052c3d1aa89e865ae366 /src | |
parent | 4007910927bf494c917ac1ffcbf8b73783541247 (diff) | |
download | dotty-3b0cb481e379ee07ce33d80a1bee5ff67c32eb40.tar.gz dotty-3b0cb481e379ee07ce33d80a1bee5ff67c32eb40.tar.bz2 dotty-3b0cb481e379ee07ce33d80a1bee5ff67c32eb40.zip |
LambdaLift: do not close over members that are static.
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/transform/LambdaLift.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/transform/LambdaLift.scala b/src/dotty/tools/dotc/transform/LambdaLift.scala index 83f272b01..5fbe0343f 100644 --- a/src/dotty/tools/dotc/transform/LambdaLift.scala +++ b/src/dotty/tools/dotc/transform/LambdaLift.scala @@ -251,8 +251,8 @@ class LambdaLift extends MiniPhase with IdentityDenotTransformer { thisTransform } def captureImplicitThis(x: Type): Unit = { x match { - case TermRef(x, _) => captureImplicitThis(x) - case x: ThisType => narrowTo(x.tref.typeSymbol.asClass) + case tr@TermRef(x, _) if (!tr.termSymbol.isStatic) => captureImplicitThis(x) + case x: ThisType if (!x.tref.typeSymbol.isStaticOwner) => narrowTo(x.tref.typeSymbol.asClass) case _ => } } |