File tree 2 files changed +15
-4
lines changed
compiler/src/dotty/tools/dotc/transform
2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -111,10 +111,7 @@ class CapturedVars extends MiniPhase with IdentityDenotTransformer { thisPhase =
111
111
def boxMethod (name : TermName ): Tree =
112
112
ref(vble.info.classSymbol.companionModule.info.member(name).symbol)
113
113
cpy.ValDef (vdef)(
114
- rhs = vdef.rhs match {
115
- case EmptyTree => boxMethod(nme.zero).appliedToNone.withPos(vdef.pos)
116
- case arg => boxMethod(nme.create).appliedTo(arg)
117
- },
114
+ rhs = boxMethod(nme.create).appliedTo(vdef.rhs),
118
115
tpt = TypeTree (vble.info).withPos(vdef.tpt.pos))
119
116
} else vdef
120
117
}
Original file line number Diff line number Diff line change
1
+ abstract class Test {
2
+
3
+ var field : Int
4
+ val field2 : Int
5
+
6
+ def foo () = {
7
+
8
+ var x : Int = 1
9
+
10
+ def inner () = {
11
+ x = x + 1 + field + field2
12
+ }
13
+ }
14
+ }
You can’t perform that action at this time.
0 commit comments