Skip to content

Commit 3b0cb48

Browse files
committed
LambdaLift: do not close over members that are static.
1 parent 4007910 commit 3b0cb48

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/dotty/tools/dotc/transform/LambdaLift.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,8 @@ class LambdaLift extends MiniPhase with IdentityDenotTransformer { thisTransform
251251
}
252252
def captureImplicitThis(x: Type): Unit = {
253253
x match {
254-
case TermRef(x, _) => captureImplicitThis(x)
255-
case x: ThisType => narrowTo(x.tref.typeSymbol.asClass)
254+
case tr@TermRef(x, _) if (!tr.termSymbol.isStatic) => captureImplicitThis(x)
255+
case x: ThisType if (!x.tref.typeSymbol.isStaticOwner) => narrowTo(x.tref.typeSymbol.asClass)
256256
case _ =>
257257
}
258258
}

0 commit comments

Comments
 (0)