KT-443 Write allowed to super.val
This commit is contained in:
@@ -45,6 +45,18 @@ public class JetControlFlowProcessor {
|
|||||||
}
|
}
|
||||||
builder.exitSubroutine(subroutineElement);
|
builder.exitSubroutine(subroutineElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void processLocalDeclaration(@NotNull JetDeclaration subroutineElement, @NotNull JetExpression body) {
|
||||||
|
processLocalDeclaration(subroutineElement, Collections.singletonList(body));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void processLocalDeclaration(@NotNull JetDeclaration subroutineElement, @NotNull List<? extends JetElement> body) {
|
||||||
|
Label afterDeclaration = builder.createUnboundLabel();
|
||||||
|
builder.nondeterministicJump(afterDeclaration);
|
||||||
|
generateSubroutineControlFlow(subroutineElement, body);
|
||||||
|
builder.bindLabel(afterDeclaration);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private class CFPVisitor extends JetVisitorVoid {
|
private class CFPVisitor extends JetVisitorVoid {
|
||||||
private final boolean inCondition;
|
private final boolean inCondition;
|
||||||
@@ -548,10 +560,7 @@ public class JetControlFlowProcessor {
|
|||||||
public void visitNamedFunction(JetNamedFunction function) {
|
public void visitNamedFunction(JetNamedFunction function) {
|
||||||
JetExpression bodyExpression = function.getBodyExpression();
|
JetExpression bodyExpression = function.getBodyExpression();
|
||||||
if (bodyExpression != null) {
|
if (bodyExpression != null) {
|
||||||
Label afterFunctionLabel = builder.createUnboundLabel();
|
processLocalDeclaration(function, bodyExpression);
|
||||||
builder.nondeterministicJump(afterFunctionLabel);
|
|
||||||
generate(function, bodyExpression);
|
|
||||||
builder.bindLabel(afterFunctionLabel);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -561,10 +570,7 @@ public class JetControlFlowProcessor {
|
|||||||
JetBlockExpression bodyExpression = functionLiteral.getBodyExpression();
|
JetBlockExpression bodyExpression = functionLiteral.getBodyExpression();
|
||||||
if (bodyExpression != null) {
|
if (bodyExpression != null) {
|
||||||
List<JetElement> statements = bodyExpression.getStatements();
|
List<JetElement> statements = bodyExpression.getStatements();
|
||||||
Label afterFunctionLiteralLabel = builder.createUnboundLabel();
|
processLocalDeclaration(functionLiteral, statements);
|
||||||
builder.nondeterministicJump(afterFunctionLiteralLabel);
|
|
||||||
generateSubroutineControlFlow(functionLiteral, statements);
|
|
||||||
builder.bindLabel(afterFunctionLiteralLabel);
|
|
||||||
}
|
}
|
||||||
builder.read(expression);
|
builder.read(expression);
|
||||||
}
|
}
|
||||||
@@ -644,6 +650,14 @@ public class JetControlFlowProcessor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void visitPropertyAccessor(JetPropertyAccessor accessor) {
|
||||||
|
JetExpression bodyExpression = accessor.getBodyExpression();
|
||||||
|
if (bodyExpression != null) {
|
||||||
|
processLocalDeclaration(accessor, bodyExpression);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void visitTupleExpression(JetTupleExpression expression) {
|
public void visitTupleExpression(JetTupleExpression expression) {
|
||||||
for (JetExpression entry : expression.getEntries()) {
|
for (JetExpression entry : expression.getEntries()) {
|
||||||
@@ -788,12 +802,21 @@ public class JetControlFlowProcessor {
|
|||||||
|
|
||||||
private void visitClassOrObject(JetClassOrObject classOrObject) {
|
private void visitClassOrObject(JetClassOrObject classOrObject) {
|
||||||
List<JetDeclaration> declarations = classOrObject.getDeclarations();
|
List<JetDeclaration> declarations = classOrObject.getDeclarations();
|
||||||
|
List<JetProperty> properties = Lists.newArrayList();
|
||||||
for (JetDeclaration declaration : declarations) {
|
for (JetDeclaration declaration : declarations) {
|
||||||
if (declaration instanceof JetProperty || declaration instanceof JetClassInitializer) {
|
if (declaration instanceof JetProperty) {
|
||||||
//declaration.accept(this);
|
value(declaration, inCondition);
|
||||||
|
properties.add((JetProperty) declaration);
|
||||||
|
}
|
||||||
|
else if (declaration instanceof JetClassInitializer) {
|
||||||
value(declaration, inCondition);
|
value(declaration, inCondition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (JetProperty property : properties) {
|
||||||
|
for (JetPropertyAccessor accessor : property.getAccessors()) {
|
||||||
|
value(accessor, inCondition);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -250,9 +250,7 @@ public class JetFlowInformationProvider {
|
|||||||
for (Instruction instruction : pseudocode.getInstructions()) {
|
for (Instruction instruction : pseudocode.getInstructions()) {
|
||||||
if (instruction instanceof LocalDeclarationInstruction) {
|
if (instruction instanceof LocalDeclarationInstruction) {
|
||||||
JetElement element = ((LocalDeclarationInstruction) instruction).getElement();
|
JetElement element = ((LocalDeclarationInstruction) instruction).getElement();
|
||||||
if (element instanceof JetNamedFunction) {
|
markUninitializedVariables(element, false, analyzeLocalDeclaration);
|
||||||
markUninitializedVariables(element, false, analyzeLocalDeclaration);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-15
@@ -2,10 +2,7 @@ package org.jetbrains.jet.lang.cfg.pseudocode;
|
|||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.jet.lang.psi.JetClass;
|
import org.jetbrains.jet.lang.psi.*;
|
||||||
import org.jetbrains.jet.lang.psi.JetDeclaration;
|
|
||||||
import org.jetbrains.jet.lang.psi.JetFunction;
|
|
||||||
import org.jetbrains.jet.lang.psi.JetObjectDeclaration;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@@ -49,16 +46,6 @@ public class LocalDeclarationInstruction extends InstructionWithNext {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
String kind = "!";
|
return "d" + "(" + element.getText() + ")";
|
||||||
if (element instanceof JetFunction) {
|
|
||||||
kind = "f";
|
|
||||||
}
|
|
||||||
else if (element instanceof JetClass) {
|
|
||||||
kind = "c";
|
|
||||||
}
|
|
||||||
else if (element instanceof JetObjectDeclaration) {
|
|
||||||
kind = "o";
|
|
||||||
}
|
|
||||||
return "d" + kind + "(" + element.getText() + ")";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,16 @@
|
|||||||
|
== get_j ==
|
||||||
|
get() = 20
|
||||||
|
---------------------
|
||||||
|
l3:
|
||||||
|
<START> NEXT:[r(20)] PREV:[]
|
||||||
|
r(20) NEXT:[<END>] PREV:[<START>]
|
||||||
|
l4:
|
||||||
|
<END> NEXT:[<SINK>] PREV:[r(20)]
|
||||||
|
error:
|
||||||
|
<ERROR> NEXT:[] PREV:[]
|
||||||
|
sink:
|
||||||
|
<SINK> NEXT:[] PREV:[<END>]
|
||||||
|
=====================
|
||||||
== AnonymousInitializers ==
|
== AnonymousInitializers ==
|
||||||
class AnonymousInitializers() {
|
class AnonymousInitializers() {
|
||||||
val k = 34
|
val k = 34
|
||||||
@@ -16,15 +29,27 @@ class AnonymousInitializers() {
|
|||||||
}
|
}
|
||||||
---------------------
|
---------------------
|
||||||
l0:
|
l0:
|
||||||
<START> NEXT:[r(34)] PREV:[]
|
<START> NEXT:[r(34)] PREV:[]
|
||||||
r(34) NEXT:[w(k)] PREV:[<START>]
|
r(34) NEXT:[w(k)] PREV:[<START>]
|
||||||
w(k) NEXT:[r(12)] PREV:[r(34)]
|
w(k) NEXT:[r(12)] PREV:[r(34)]
|
||||||
r(12) NEXT:[w($i)] PREV:[w(k)]
|
r(12) NEXT:[w($i)] PREV:[w(k)]
|
||||||
w($i) NEXT:[r(13)] PREV:[r(12)]
|
w($i) NEXT:[r(13)] PREV:[r(12)]
|
||||||
r(13) NEXT:[w($i)] PREV:[w($i)]
|
r(13) NEXT:[w($i)] PREV:[w($i)]
|
||||||
w($i) NEXT:[<END>] PREV:[r(13)]
|
w($i) NEXT:[jmp?(l2)] PREV:[r(13)]
|
||||||
|
jmp?(l2) NEXT:[<END>, d(get() = 20)] PREV:[w($i)]
|
||||||
|
d(get() = 20) NEXT:[<SINK>] PREV:[jmp?(l2)]
|
||||||
l1:
|
l1:
|
||||||
<END> NEXT:[<SINK>] PREV:[w($i)]
|
l2:
|
||||||
|
<END> NEXT:[<SINK>] PREV:[jmp?(l2)]
|
||||||
|
error:
|
||||||
|
<ERROR> NEXT:[] PREV:[]
|
||||||
|
sink:
|
||||||
|
<SINK> NEXT:[] PREV:[d(get() = 20), <END>]
|
||||||
|
l3:
|
||||||
|
<START> NEXT:[r(20)] PREV:[]
|
||||||
|
r(20) NEXT:[<END>] PREV:[<START>]
|
||||||
|
l4:
|
||||||
|
<END> NEXT:[<SINK>] PREV:[r(20)]
|
||||||
error:
|
error:
|
||||||
<ERROR> NEXT:[] PREV:[]
|
<ERROR> NEXT:[] PREV:[]
|
||||||
sink:
|
sink:
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ l0:
|
|||||||
r(foo(a, 3)) NEXT:[r(genfun)] PREV:[r(foo)]
|
r(foo(a, 3)) NEXT:[r(genfun)] PREV:[r(foo)]
|
||||||
r(genfun) NEXT:[r(genfun<Any>())] PREV:[r(foo(a, 3))]
|
r(genfun) NEXT:[r(genfun<Any>())] PREV:[r(foo(a, 3))]
|
||||||
r(genfun<Any>()) NEXT:[jmp?(l2)] PREV:[r(genfun)]
|
r(genfun<Any>()) NEXT:[jmp?(l2)] PREV:[r(genfun)]
|
||||||
jmp?(l2) NEXT:[r({1}), df({1})] PREV:[r(genfun<Any>())]
|
jmp?(l2) NEXT:[r({1}), d({1})] PREV:[r(genfun<Any>())]
|
||||||
df({1}) NEXT:[<SINK>] PREV:[jmp?(l2)]
|
d({1}) NEXT:[<SINK>] PREV:[jmp?(l2)]
|
||||||
l2:
|
l2:
|
||||||
r({1}) NEXT:[r(flfun)] PREV:[jmp?(l2)]
|
r({1}) NEXT:[r(flfun)] PREV:[jmp?(l2)]
|
||||||
r(flfun) NEXT:[r(flfun {1})] PREV:[r({1})]
|
r(flfun) NEXT:[r(flfun {1})] PREV:[r({1})]
|
||||||
@@ -77,7 +77,7 @@ l1:
|
|||||||
error:
|
error:
|
||||||
<ERROR> NEXT:[] PREV:[]
|
<ERROR> NEXT:[] PREV:[]
|
||||||
sink:
|
sink:
|
||||||
<SINK> NEXT:[] PREV:[df({1}), <END>]
|
<SINK> NEXT:[] PREV:[d({1}), <END>]
|
||||||
l3:
|
l3:
|
||||||
<START> NEXT:[r(1)] PREV:[]
|
<START> NEXT:[r(1)] PREV:[]
|
||||||
r(1) NEXT:[<END>] PREV:[<START>]
|
r(1) NEXT:[<END>] PREV:[<START>]
|
||||||
|
|||||||
@@ -100,8 +100,8 @@ l0:
|
|||||||
<START> NEXT:[jmp?(l2)] PREV:[]
|
<START> NEXT:[jmp?(l2)] PREV:[]
|
||||||
jmp?(l2) NEXT:[r(2), r(1)] PREV:[<START>]
|
jmp?(l2) NEXT:[r(2), r(1)] PREV:[<START>]
|
||||||
r(1) NEXT:[jmp?(l3)] PREV:[jmp?(l2)]
|
r(1) NEXT:[jmp?(l3)] PREV:[jmp?(l2)]
|
||||||
jmp?(l3) NEXT:[r({ () => if (2 > 3) { retur..), df({ () => if (2 > 3) { retu..)] PREV:[r(1)]
|
jmp?(l3) NEXT:[r({ () => if (2 > 3) { retur..), d({ () => if (2 > 3) { retur..)] PREV:[r(1)]
|
||||||
df({ () =>
|
d({ () =>
|
||||||
if (2 > 3) {
|
if (2 > 3) {
|
||||||
return@
|
return@
|
||||||
}
|
}
|
||||||
@@ -119,7 +119,7 @@ l1:
|
|||||||
error:
|
error:
|
||||||
<ERROR> NEXT:[] PREV:[]
|
<ERROR> NEXT:[] PREV:[]
|
||||||
sink:
|
sink:
|
||||||
<SINK> NEXT:[] PREV:[df({ () => if (2 > 3) { retu..), <END>]
|
<SINK> NEXT:[] PREV:[d({ () => if (2 > 3) { retur..), <END>]
|
||||||
l4:
|
l4:
|
||||||
<START> NEXT:[r(2)] PREV:[]
|
<START> NEXT:[r(2)] PREV:[]
|
||||||
r(2) NEXT:[r(3)] PREV:[<START>]
|
r(2) NEXT:[r(3)] PREV:[<START>]
|
||||||
@@ -191,8 +191,8 @@ fun t4() {
|
|||||||
---------------------
|
---------------------
|
||||||
l0:
|
l0:
|
||||||
<START> NEXT:[jmp?(l2)] PREV:[]
|
<START> NEXT:[jmp?(l2)] PREV:[]
|
||||||
jmp?(l2) NEXT:[r({ () => try { 1 if (2 > 3)..), df({ () => try { 1 if (2 > 3..)] PREV:[<START>]
|
jmp?(l2) NEXT:[r({ () => try { 1 if (2 > 3)..), d({ () => try { 1 if (2 > 3)..)] PREV:[<START>]
|
||||||
df({ () =>
|
d({ () =>
|
||||||
try {
|
try {
|
||||||
1
|
1
|
||||||
if (2 > 3) {
|
if (2 > 3) {
|
||||||
@@ -218,7 +218,7 @@ l1:
|
|||||||
error:
|
error:
|
||||||
<ERROR> NEXT:[] PREV:[]
|
<ERROR> NEXT:[] PREV:[]
|
||||||
sink:
|
sink:
|
||||||
<SINK> NEXT:[] PREV:[df({ () => try { 1 if (2 > 3..), <END>]
|
<SINK> NEXT:[] PREV:[d({ () => try { 1 if (2 > 3)..), <END>]
|
||||||
l3:
|
l3:
|
||||||
<START> NEXT:[jmp?(l5)] PREV:[]
|
<START> NEXT:[jmp?(l5)] PREV:[]
|
||||||
jmp?(l5) NEXT:[r(2), r(1)] PREV:[<START>]
|
jmp?(l5) NEXT:[r(2), r(1)] PREV:[<START>]
|
||||||
|
|||||||
@@ -166,25 +166,25 @@ fun test3() {
|
|||||||
}
|
}
|
||||||
---------------------
|
---------------------
|
||||||
l0:
|
l0:
|
||||||
<START> NEXT:[jmp?(l2)] PREV:[]
|
<START> NEXT:[jmp?(l2)] PREV:[]
|
||||||
jmp?(l2) NEXT:[r(object { val y : Int fun i..), df(fun inner_bar() { y = 10 ..)] PREV:[<START>]
|
jmp?(l2) NEXT:[r(object { val y : Int fun i..), d(fun inner_bar() { y = 10 }) ] PREV:[<START>]
|
||||||
df(fun inner_bar() {
|
d(fun inner_bar() {
|
||||||
y = 10
|
y = 10
|
||||||
}) NEXT:[<SINK>] PREV:[jmp?(l2)]
|
}) NEXT:[<SINK>] PREV:[jmp?(l2)]
|
||||||
l2:
|
l2:
|
||||||
r(object {
|
r(object {
|
||||||
val y : Int
|
val y : Int
|
||||||
fun inner_bar() {
|
fun inner_bar() {
|
||||||
y = 10
|
y = 10
|
||||||
}
|
}
|
||||||
}) NEXT:[w(a)] PREV:[jmp?(l2)]
|
}) NEXT:[w(a)] PREV:[jmp?(l2)]
|
||||||
w(a) NEXT:[<END>] PREV:[r(object { val y : Int fun i..)]
|
w(a) NEXT:[<END>] PREV:[r(object { val y : Int fun i..)]
|
||||||
l1:
|
l1:
|
||||||
<END> NEXT:[<SINK>] PREV:[w(a)]
|
<END> NEXT:[<SINK>] PREV:[w(a)]
|
||||||
error:
|
error:
|
||||||
<ERROR> NEXT:[] PREV:[]
|
<ERROR> NEXT:[] PREV:[]
|
||||||
sink:
|
sink:
|
||||||
<SINK> NEXT:[] PREV:[df(fun inner_bar() { y = 10 ..), <END>]
|
<SINK> NEXT:[] PREV:[d(fun inner_bar() { y = 10 }) , <END>]
|
||||||
l3:
|
l3:
|
||||||
<START> NEXT:[r(10)] PREV:[]
|
<START> NEXT:[r(10)] PREV:[]
|
||||||
r(10) NEXT:[w(y)] PREV:[<START>]
|
r(10) NEXT:[w(y)] PREV:[<START>]
|
||||||
@@ -227,13 +227,13 @@ fun test4() {
|
|||||||
}
|
}
|
||||||
---------------------
|
---------------------
|
||||||
l0:
|
l0:
|
||||||
<START> NEXT:[r(1)] PREV:[]
|
<START> NEXT:[r(1)] PREV:[]
|
||||||
r(1) NEXT:[w($x)] PREV:[<START>]
|
r(1) NEXT:[w($x)] PREV:[<START>]
|
||||||
w($x) NEXT:[jmp?(l2)] PREV:[r(1)]
|
w($x) NEXT:[jmp?(l2)] PREV:[r(1)]
|
||||||
jmp?(l2) NEXT:[r(object { val x : Int val y..), df(fun ggg() { y = 10 }) ] PREV:[w($x)]
|
jmp?(l2) NEXT:[r(object { val x : Int val y..), d(fun ggg() { y = 10 }) ] PREV:[w($x)]
|
||||||
df(fun ggg() {
|
d(fun ggg() {
|
||||||
y = 10
|
y = 10
|
||||||
}) NEXT:[<SINK>] PREV:[jmp?(l2)]
|
}) NEXT:[<SINK>] PREV:[jmp?(l2)]
|
||||||
l2:
|
l2:
|
||||||
r(object {
|
r(object {
|
||||||
val x : Int
|
val x : Int
|
||||||
@@ -244,14 +244,14 @@ l2:
|
|||||||
fun ggg() {
|
fun ggg() {
|
||||||
y = 10
|
y = 10
|
||||||
}
|
}
|
||||||
}) NEXT:[w(a)] PREV:[jmp?(l2)]
|
}) NEXT:[w(a)] PREV:[jmp?(l2)]
|
||||||
w(a) NEXT:[<END>] PREV:[r(object { val x : Int val y..)]
|
w(a) NEXT:[<END>] PREV:[r(object { val x : Int val y..)]
|
||||||
l1:
|
l1:
|
||||||
<END> NEXT:[<SINK>] PREV:[w(a)]
|
<END> NEXT:[<SINK>] PREV:[w(a)]
|
||||||
error:
|
error:
|
||||||
<ERROR> NEXT:[] PREV:[]
|
<ERROR> NEXT:[] PREV:[]
|
||||||
sink:
|
sink:
|
||||||
<SINK> NEXT:[] PREV:[df(fun ggg() { y = 10 }) , <END>]
|
<SINK> NEXT:[] PREV:[d(fun ggg() { y = 10 }) , <END>]
|
||||||
l3:
|
l3:
|
||||||
<START> NEXT:[r(10)] PREV:[]
|
<START> NEXT:[r(10)] PREV:[]
|
||||||
r(10) NEXT:[w(y)] PREV:[<START>]
|
r(10) NEXT:[w(y)] PREV:[<START>]
|
||||||
@@ -312,20 +312,20 @@ fun test5() {
|
|||||||
}
|
}
|
||||||
---------------------
|
---------------------
|
||||||
l0:
|
l0:
|
||||||
<START> NEXT:[r(1)] PREV:[]
|
<START> NEXT:[r(1)] PREV:[]
|
||||||
r(1) NEXT:[w(x)] PREV:[<START>]
|
r(1) NEXT:[w(x)] PREV:[<START>]
|
||||||
w(x) NEXT:[r(2)] PREV:[r(1)]
|
w(x) NEXT:[r(2)] PREV:[r(1)]
|
||||||
r(2) NEXT:[w($x)] PREV:[w(x)]
|
r(2) NEXT:[w($x)] PREV:[w(x)]
|
||||||
w($x) NEXT:[jmp?(l2)] PREV:[r(2)]
|
w($x) NEXT:[jmp?(l2)] PREV:[r(2)]
|
||||||
jmp?(l2) NEXT:[jmp?(l5), df(fun foo() { x = 3 }) ] PREV:[w($x)]
|
jmp?(l2) NEXT:[jmp?(l5), d(fun foo() { x = 3 }) ] PREV:[w($x)]
|
||||||
df(fun foo() {
|
d(fun foo() {
|
||||||
x = 3
|
x = 3
|
||||||
}) NEXT:[<SINK>] PREV:[jmp?(l2)]
|
}) NEXT:[<SINK>] PREV:[jmp?(l2)]
|
||||||
l2:
|
l2:
|
||||||
jmp?(l5) NEXT:[r(object { var x = 1 { $x = ..), df(fun bar() { x = 4 }) ] PREV:[jmp?(l2)]
|
jmp?(l5) NEXT:[r(object { var x = 1 { $x = ..), d(fun bar() { x = 4 }) ] PREV:[jmp?(l2)]
|
||||||
df(fun bar() {
|
d(fun bar() {
|
||||||
x = 4
|
x = 4
|
||||||
}) NEXT:[<SINK>] PREV:[jmp?(l5)]
|
}) NEXT:[<SINK>] PREV:[jmp?(l5)]
|
||||||
l5:
|
l5:
|
||||||
r(object {
|
r(object {
|
||||||
var x = 1
|
var x = 1
|
||||||
@@ -338,14 +338,14 @@ l5:
|
|||||||
fun bar() {
|
fun bar() {
|
||||||
x = 4
|
x = 4
|
||||||
}
|
}
|
||||||
}) NEXT:[w(a)] PREV:[jmp?(l5)]
|
}) NEXT:[w(a)] PREV:[jmp?(l5)]
|
||||||
w(a) NEXT:[<END>] PREV:[r(object { var x = 1 { $x = ..)]
|
w(a) NEXT:[<END>] PREV:[r(object { var x = 1 { $x = ..)]
|
||||||
l1:
|
l1:
|
||||||
<END> NEXT:[<SINK>] PREV:[w(a)]
|
<END> NEXT:[<SINK>] PREV:[w(a)]
|
||||||
error:
|
error:
|
||||||
<ERROR> NEXT:[] PREV:[]
|
<ERROR> NEXT:[] PREV:[]
|
||||||
sink:
|
sink:
|
||||||
<SINK> NEXT:[] PREV:[df(fun foo() { x = 3 }) , df(fun bar() { x = 4 }) , <END>]
|
<SINK> NEXT:[] PREV:[d(fun foo() { x = 3 }) , d(fun bar() { x = 4 }) , <END>]
|
||||||
l3:
|
l3:
|
||||||
<START> NEXT:[r(3)] PREV:[]
|
<START> NEXT:[r(3)] PREV:[]
|
||||||
r(3) NEXT:[w(x)] PREV:[<START>]
|
r(3) NEXT:[w(x)] PREV:[<START>]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// KT-439 Support labeled function lliterals in call arguments
|
// KT-439 Support labeled function literals in call arguments
|
||||||
|
|
||||||
inline fun run1<T>(body : fun() : T) : T = body()
|
inline fun run1<T>(body : fun() : T) : T = body()
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
// KT-443 Write allowed to super.val
|
||||||
|
|
||||||
|
open class M() {
|
||||||
|
open val b: Int = 5
|
||||||
|
}
|
||||||
|
|
||||||
|
class N() : M() {
|
||||||
|
val a : Int
|
||||||
|
get() {
|
||||||
|
<!VAL_REASSIGNMENT!>super.b<!> = super.b + 1
|
||||||
|
return super.b + 1
|
||||||
|
}
|
||||||
|
override val b: Int = a + 1
|
||||||
|
}
|
||||||
@@ -100,7 +100,7 @@ public class JetControlFlowTest extends JetLiteFixture {
|
|||||||
for (Pseudocode pseudocode : pseudocodes) {
|
for (Pseudocode pseudocode : pseudocodes) {
|
||||||
JetElement correspondingElement = pseudocode.getCorrespondingElement();
|
JetElement correspondingElement = pseudocode.getCorrespondingElement();
|
||||||
String label = "";
|
String label = "";
|
||||||
assert (correspondingElement instanceof JetNamedDeclaration || correspondingElement instanceof JetConstructor) :
|
assert (correspondingElement instanceof JetNamedDeclaration || correspondingElement instanceof JetConstructor || correspondingElement instanceof JetPropertyAccessor) :
|
||||||
"Unexpected element class is pseudocode: " + correspondingElement.getClass();
|
"Unexpected element class is pseudocode: " + correspondingElement.getClass();
|
||||||
if (correspondingElement instanceof JetFunctionLiteral) {
|
if (correspondingElement instanceof JetFunctionLiteral) {
|
||||||
label = "anonymous_" + i++;
|
label = "anonymous_" + i++;
|
||||||
@@ -109,7 +109,11 @@ public class JetControlFlowTest extends JetLiteFixture {
|
|||||||
JetNamedDeclaration namedDeclaration = (JetNamedDeclaration) correspondingElement;
|
JetNamedDeclaration namedDeclaration = (JetNamedDeclaration) correspondingElement;
|
||||||
label = namedDeclaration.getName();
|
label = namedDeclaration.getName();
|
||||||
}
|
}
|
||||||
else {
|
else if (correspondingElement instanceof JetPropertyAccessor) {
|
||||||
|
String propertyName = ((JetProperty) correspondingElement.getParent()).getName();
|
||||||
|
label = (((JetPropertyAccessor) correspondingElement).isGetter() ? "get" : "set") + "_" + propertyName;
|
||||||
|
}
|
||||||
|
else if (correspondingElement instanceof JetConstructor) {
|
||||||
label = "this";
|
label = "this";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user