From 3b0cb481e379ee07ce33d80a1bee5ff67c32eb40 Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Fri, 27 May 2016 13:18:52 +0200 Subject: LambdaLift: do not close over members that are static. --- src/dotty/tools/dotc/transform/LambdaLift.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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 _ => } } -- cgit v1.2.3