File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 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 =
111111 def boxMethod (name : TermName ): Tree =
112112 ref(vble.info.classSymbol.companionModule.info.member(name).symbol)
113113 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),
118115 tpt = TypeTree (vble.info).withPos(vdef.tpt.pos))
119116 } else vdef
120117 }
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