File tree 2 files changed +17
-2
lines changed
src/dotty/tools/dotc/transform 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -394,8 +394,13 @@ class LambdaLift extends MiniPhase with IdentityDenotTransformer { thisTransform
394
394
val sym = tree.symbol
395
395
tree.tpe match {
396
396
case tpe @ TermRef (prefix, _) =>
397
- if ((prefix eq NoPrefix ) && sym.enclosure != currentEnclosure && ! sym.isStatic)
398
- (if (sym is Method ) memberRef(sym) else proxyRef(sym)).withPos(tree.pos)
397
+ if (prefix eq NoPrefix )
398
+ if (sym.enclosure != currentEnclosure && ! sym.isStatic)
399
+ (if (sym is Method ) memberRef(sym) else proxyRef(sym)).withPos(tree.pos)
400
+ else if (sym.owner.isClass) // sym was lifted out
401
+ ref(sym).withPos(tree.pos)
402
+ else
403
+ tree
399
404
else if (! prefixIsElidable(tpe)) ref(tpe)
400
405
else tree
401
406
case _ =>
Original file line number Diff line number Diff line change
1
+ object Test {
2
+ def test2 : Int = {
3
+ var ds : String = null
4
+ def s = {
5
+ ds = " abs"
6
+ ds
7
+ }
8
+ s.length
9
+ }
10
+ }
You can’t perform that action at this time.
0 commit comments