Change ControlFlow for delegated property

This commit is contained in:
Natalia.Ukhorskaya
2013-04-29 15:48:09 +04:00
parent 29984efe76
commit 171144e641
3 changed files with 37 additions and 0 deletions
@@ -718,6 +718,10 @@ public class JetControlFlowProcessor {
generateInstructions(initializer, false);
builder.write(property, property);
}
JetExpression delegate = property.getDelegateExpression();
if (delegate != null) {
generateInstructions(delegate, false);
}
for (JetPropertyAccessor accessor : property.getAccessors()) {
generateInstructions(accessor, false);
}
@@ -0,0 +1,30 @@
== a ==
val a = Delegate()
---------------------
L0:
<START> NEXT:[v(val a = Delegate())] PREV:[]
v(val a = Delegate()) NEXT:[r(Delegate)] PREV:[<START>]
r(Delegate) NEXT:[r(Delegate())] PREV:[v(val a = Delegate())]
r(Delegate()) NEXT:[w(a)] PREV:[r(Delegate)]
w(a) NEXT:[<END>] PREV:[r(Delegate())]
L1:
<END> NEXT:[<SINK>] PREV:[w(a)]
error:
<ERROR> NEXT:[<SINK>] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<ERROR>, <END>]
=====================
== b ==
val b by a
---------------------
L0:
<START> NEXT:[v(val b by a)] PREV:[]
v(val b by a) NEXT:[r(a)] PREV:[<START>]
r(a) NEXT:[<END>] PREV:[v(val b by a)]
L1:
<END> NEXT:[<SINK>] PREV:[r(a)]
error:
<ERROR> NEXT:[<SINK>] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<ERROR>, <END>]
=====================
@@ -0,0 +1,3 @@
val a = Delegate()
val b by a