[FIR] Disable data flow from in-place lambdas

There are many complications with the current design of passing data
from within in-place lambdas to surrounding code. Solving these
complications will involve more time to investigation than is available
within the K2 release. So we are disabling passing type statement
information from lambdas for the time being until more time can be
devoted to a more complete solution.

^KT-60958 Fixed
^KT-63530 Fixed
This commit is contained in:
Brian Norman
2023-12-11 10:25:48 -06:00
committed by Space Team
parent 645970fa7a
commit b2041e0927
68 changed files with 2834 additions and 2962 deletions
@@ -110,7 +110,7 @@ digraph defaultArguments_kt {
25 -> {26};
26 -> {28};
27 -> {29};
28 -> {29};
28 -> {29} [label="Postponed"];
29 -> {30};
30 -> {31};
31 -> {32};
File diff suppressed because it is too large Load Diff
@@ -76,7 +76,7 @@ FILE: flowFromInplaceLambda.kt
^ (R|<local>/x| as R|kotlin/Int|)
}
)
R|<local>/x|.R|kotlin/Int.inc|()
R|<local>/x|.<Unresolved name: inc>#()
}
public final fun completedCallExactlyOnce(x: R|kotlin/Any?|, y: R|kotlin/Any?|): R|kotlin/Unit| {
R|/select|<R|kotlin/Int|>(vararg(R|/id|<R|kotlin/Int|>(R|/exactlyOnce|<R|kotlin/Int|>(<L> = exactlyOnce@fun <anonymous>(): R|kotlin/Int| <inline=NoInline, kind=EXACTLY_ONCE> {
@@ -89,7 +89,7 @@ FILE: flowFromInplaceLambda.kt
^ Int(1)
}
))).R|kotlin/Int.inc|()
R|<local>/x|.R|kotlin/Int.inc|()
R|<local>/x|.<Unresolved name: inc>#()
R|<local>/y|.R|kotlin/Int.inc|()
}
public final fun completedCallAtLeastOnce(x: R|kotlin/Any?|, y: R|kotlin/Any?|): R|kotlin/Unit| {
@@ -103,7 +103,7 @@ FILE: flowFromInplaceLambda.kt
^ Int(1)
}
))).R|kotlin/Int.inc|()
R|<local>/x|.R|kotlin/Int.inc|()
R|<local>/x|.<Unresolved name: inc>#()
R|<local>/y|.R|kotlin/Int.inc|()
}
public final fun completedCallAtMostOnce(x: R|kotlin/Any?|, y: R|kotlin/Any?|): R|kotlin/Unit| {
@@ -162,8 +162,8 @@ FILE: flowFromInplaceLambda.kt
^ Int(1)
}
))).R|kotlin/Int.inc|()
R|<local>/x|.R|kotlin/Int.inc|()
R|<local>/y|.R|kotlin/Int.inc|()
R|<local>/x|.<Unresolved name: inc>#()
R|<local>/y|.<Unresolved name: inc>#()
}
public final fun incompleteCallAtLeastOnce(x: R|kotlin/Any|, y: R|kotlin/Any|): R|kotlin/Unit| {
R|/select|<R|kotlin/Int|>(vararg(R|/id|<R|kotlin/Int|>(R|/atLeastOnce|<R|kotlin/Int|>(<L> = atLeastOnce@fun <anonymous>(): R|kotlin/Int| <inline=NoInline, kind=AT_LEAST_ONCE> {
@@ -179,8 +179,8 @@ FILE: flowFromInplaceLambda.kt
^ Int(1)
}
))).R|kotlin/Int.inc|()
R|<local>/x|.R|kotlin/Int.inc|()
R|<local>/y|.R|kotlin/Int.inc|()
R|<local>/x|.<Unresolved name: inc>#()
R|<local>/y|.<Unresolved name: inc>#()
}
public final fun incompleteCallAtMostOnce(x: R|kotlin/Any|, y: R|kotlin/Any|): R|kotlin/Unit| {
R|/select|<R|kotlin/Int|>(vararg(R|/id|<R|kotlin/Int|>(R|/atMostOnce|<R|kotlin/Int|>(<L> = atMostOnce@fun <anonymous>(): R|kotlin/Int| <inline=NoInline, kind=AT_MOST_ONCE> {
@@ -31,7 +31,7 @@ fun <K> materialize(): K = null!!
fun basic(x: Any?) {
exactlyOnce { x as Int }
x.inc() // OK
x.<!UNRESOLVED_REFERENCE!>inc<!>() // Bad: KT-37838 -> OK
}
fun completedCallExactlyOnce(x: Any?, y: Any?) {
@@ -41,7 +41,7 @@ fun completedCallExactlyOnce(x: Any?, y: Any?) {
y as Int,
exactlyOnce { x.<!UNRESOLVED_REFERENCE!>inc<!>(); y.inc(); 1 }
).inc() // OK
x.inc() // OK
x.<!UNRESOLVED_REFERENCE!>inc<!>() // Bad: KT-37838 -> OK
y.inc() // OK
}
@@ -51,7 +51,7 @@ fun completedCallAtLeastOnce(x: Any?, y: Any?) {
y as Int,
atLeastOnce { x.<!UNRESOLVED_REFERENCE!>inc<!>(); y.inc(); 1 }
).inc() // OK
x.inc() // OK
x.<!UNRESOLVED_REFERENCE!>inc<!>() // Bad: KT-37838 -> OK
y.inc() // OK
}
@@ -91,8 +91,8 @@ fun incompleteCallExactlyOnce(x: Any, y: Any) {
id(exactlyOnce { x as Int; y.<!UNRESOLVED_REFERENCE!>inc<!>(); x.inc(); materialize() }),
exactlyOnce { y as Int; x.<!UNRESOLVED_REFERENCE!>inc<!>(); y.inc(); 1 }
).inc() // OK
x.inc() // OK
y.inc() // OK
x.<!UNRESOLVED_REFERENCE!>inc<!>() // Bad: KT-37838 -> OK
y.<!UNRESOLVED_REFERENCE!>inc<!>() // Bad: KT-37838 -> OK
}
fun incompleteCallAtLeastOnce(x: Any, y: Any) {
@@ -100,8 +100,8 @@ fun incompleteCallAtLeastOnce(x: Any, y: Any) {
id(atLeastOnce { x as Int; y.<!UNRESOLVED_REFERENCE!>inc<!>(); x.inc(); materialize() }),
atLeastOnce { y as Int; x.<!UNRESOLVED_REFERENCE!>inc<!>(); y.inc(); 1 }
).inc() // OK
x.inc() // OK
y.inc() // OK
x.<!UNRESOLVED_REFERENCE!>inc<!>() // Bad: KT-37838 -> OK
y.<!UNRESOLVED_REFERENCE!>inc<!>() // Bad: KT-37838 -> OK
}
fun incompleteCallAtMostOnce(x: Any, y: Any) {
File diff suppressed because it is too large Load Diff
@@ -20,7 +20,7 @@ FILE: flowFromInplaceLambda2.kt
^ Int(123)
}
))
R|<local>/x|.R|kotlin/String.length|
R|<local>/x|.R|kotlin/String.length<Inapplicable(UNSAFE_CALL): kotlin/String.length>#|
}
public final fun test2(x: R|kotlin/String?|): R|kotlin/Unit| {
R|/foo|<R|kotlin/Int|>(R|/id|<R|kotlin/Int?|>(R|kotlin/run|<R|kotlin/Int?|>(<L> = run@fun <anonymous>(): R|kotlin/Int?| <inline=Inline, kind=EXACTLY_ONCE> {
@@ -32,7 +32,7 @@ FILE: flowFromInplaceLambda2.kt
^ Int(123)
}
))
R|<local>/x|.R|kotlin/String.length|
R|<local>/x|.R|kotlin/String.length<Inapplicable(UNSAFE_CALL): kotlin/String.length>#|
}
public final fun test3(x: R|kotlin/String?|): R|kotlin/Unit| {
R|/foo|<R|kotlin/Int|>(R|/id|<R|kotlin/Int?|>(R|kotlin/run|<R|kotlin/Int?|>(<L> = run@fun <anonymous>(): R|kotlin/Int?| <inline=Inline, kind=EXACTLY_ONCE> {
@@ -52,7 +52,7 @@ FILE: flowFromInplaceLambda2.kt
^ Int(123)
}
))
R|<local>/x|.R|kotlin/String.length|
R|<local>/x|.R|kotlin/String.length<Inapplicable(UNSAFE_CALL): kotlin/String.length>#|
}
public final fun test4(x: R|kotlin/String?|): R|kotlin/Unit| {
lvar p: R|kotlin/String?| = R|<local>/x|
@@ -14,7 +14,7 @@ fun test1(x: String?) {
1,
run { x<!UNSAFE_CALL!>.<!>length; 123 } // Bad (resolution order undefined)
)
x.length // OK (x as String unconditional)
x<!UNSAFE_CALL!>.<!>length // Bad: KT-37838 -> OK (x as String unconditional)
}
fun test2(x: String?) {
@@ -23,7 +23,7 @@ fun test2(x: String?) {
someCompletedCall(1),
run { x<!UNSAFE_CALL!>.<!>length; 123 } // Bad (resolution order undefined)
)
x.length // OK (x as String unconditional)
x<!UNSAFE_CALL!>.<!>length // OK (x as String unconditional)
}
fun test3(x: String?) {
@@ -32,7 +32,7 @@ fun test3(x: String?) {
if (true) 1 else 2,
run { x<!UNSAFE_CALL!>.<!>length; 123 } // Bad (resolution order undefined)
)
x.length // OK (x as String unconditional)
x<!UNSAFE_CALL!>.<!>length // Bad: KT-37838 -> OK (x as String unconditional)
}
fun test4(x: String?) {
@@ -62,7 +62,7 @@ fun test6(x: String?) {
1,
run { x<!UNSAFE_CALL!>.<!>length; 123 } // Bad (resolution order undefined)
)
x<!UNSAFE_CALL!>.<!>length // OK (x as String in both branches)
x<!UNSAFE_CALL!>.<!>length // Bad: KT-37838 -> OK (x as String in both branches)
}
fun test7(x: String?) {
@@ -154,19 +154,17 @@ digraph flowFromInplaceLambda3_kt {
52 [label="Postponed exit from lambda"];
53 [label="Function call: R|/unknown|(...)" style="filled" fillcolor=yellow];
54 [label="Access variable R|<local>/x|"];
55 [label="Smart cast: R|<local>/x|"];
56 [label="Access variable <Unresolved name: length>#"];
55 [label="Access variable <Unresolved name: length>#"];
subgraph cluster_21 {
color=blue
57 [label="Function call arguments enter"];
58 [label="Access variable R|<local>/x|"];
59 [label="Smart cast: R|<local>/x|"];
60 [label="Function call arguments exit"];
56 [label="Function call arguments enter"];
57 [label="Access variable R|<local>/x|"];
58 [label="Function call arguments exit"];
}
61 [label="Function call: R|<local>/x|.<Unresolved name: inc>#()" style="filled" fillcolor=yellow];
62 [label="Exit block"];
59 [label="Function call: R|<local>/x|.<Unresolved name: inc>#()" style="filled" fillcolor=yellow];
60 [label="Exit block"];
}
63 [label="Exit function test1" style="filled" fillcolor=red];
61 [label="Exit function test1" style="filled" fillcolor=red];
}
35 -> {36};
36 -> {37};
@@ -186,8 +184,8 @@ digraph flowFromInplaceLambda3_kt {
49 -> {50};
50 -> {52};
51 -> {53};
52 -> {53};
52 -> {44} [color=green style=dashed];
52 -> {53} [label="Postponed"];
53 -> {54};
54 -> {55};
55 -> {56};
@@ -196,48 +194,47 @@ digraph flowFromInplaceLambda3_kt {
58 -> {59};
59 -> {60};
60 -> {61};
61 -> {62};
62 -> {63};
subgraph cluster_22 {
color=red
64 [label="Enter function test1m" style="filled" fillcolor=red];
62 [label="Enter function test1m" style="filled" fillcolor=red];
subgraph cluster_23 {
color=blue
65 [label="Enter block"];
66 [label="Variable declaration: lvar x: R|kotlin/Any?|"];
67 [label="Const: String()"];
68 [label="Assignment: R|<local>/x|"];
69 [label="Access variable R|<local>/x|"];
70 [label="Smart cast: R|<local>/x|"];
71 [label="Access variable R|kotlin/String.length|"];
63 [label="Enter block"];
64 [label="Variable declaration: lvar x: R|kotlin/Any?|"];
65 [label="Const: String()"];
66 [label="Assignment: R|<local>/x|"];
67 [label="Access variable R|<local>/x|"];
68 [label="Smart cast: R|<local>/x|"];
69 [label="Access variable R|kotlin/String.length|"];
subgraph cluster_24 {
color=blue
72 [label="Function call arguments enter"];
73 [label="Postponed enter to lambda"];
70 [label="Function call arguments enter"];
71 [label="Postponed enter to lambda"];
subgraph cluster_25 {
color=blue
74 [label="Enter function <anonymous>" style="filled" fillcolor=red];
72 [label="Enter function <anonymous>" style="filled" fillcolor=red];
subgraph cluster_26 {
color=blue
75 [label="Enter block"];
76 [label="Const: String()"];
77 [label="Assignment: R|<local>/x|"];
78 [label="Exit block"];
73 [label="Enter block"];
74 [label="Const: String()"];
75 [label="Assignment: R|<local>/x|"];
76 [label="Exit block"];
}
79 [label="Exit function <anonymous>" style="filled" fillcolor=red];
77 [label="Exit function <anonymous>" style="filled" fillcolor=red];
}
80 [label="Function call arguments exit"];
78 [label="Function call arguments exit"];
}
81 [label="Postponed exit from lambda"];
82 [label="Function call: R|/unknown|(...)" style="filled" fillcolor=yellow];
83 [label="Access variable R|<local>/x|"];
84 [label="Smart cast: R|<local>/x|"];
85 [label="Access variable R|kotlin/String.length|"];
86 [label="Exit block"];
79 [label="Postponed exit from lambda"];
80 [label="Function call: R|/unknown|(...)" style="filled" fillcolor=yellow];
81 [label="Access variable R|<local>/x|"];
82 [label="Access variable <Unresolved name: length>#"];
83 [label="Exit block"];
}
87 [label="Exit function test1m" style="filled" fillcolor=red];
84 [label="Exit function test1m" style="filled" fillcolor=red];
}
62 -> {63};
63 -> {64};
64 -> {65};
65 -> {66};
66 -> {67};
@@ -245,257 +242,242 @@ digraph flowFromInplaceLambda3_kt {
68 -> {69};
69 -> {70};
70 -> {71};
71 -> {72};
71 -> {72 78 79};
71 -> {72} [style=dashed];
72 -> {73};
73 -> {74 80 81};
73 -> {74} [style=dashed];
73 -> {74};
74 -> {75};
75 -> {76};
76 -> {77};
77 -> {78};
78 -> {79};
79 -> {81};
80 -> {82};
77 -> {79};
78 -> {80};
79 -> {71} [color=green style=dashed];
79 -> {80} [label="Postponed"];
80 -> {81};
81 -> {82};
81 -> {73} [color=green style=dashed];
82 -> {83};
83 -> {84};
84 -> {85};
85 -> {86};
86 -> {87};
subgraph cluster_27 {
color=red
88 [label="Enter function test2" style="filled" fillcolor=red];
85 [label="Enter function test2" style="filled" fillcolor=red];
subgraph cluster_28 {
color=blue
89 [label="Enter block"];
90 [label="Variable declaration: lvar x: R|kotlin/Any?|"];
91 [label="Const: String()"];
92 [label="Assignment: R|<local>/x|"];
93 [label="Access variable R|<local>/x|"];
94 [label="Smart cast: R|<local>/x|"];
95 [label="Access variable R|kotlin/String.length|"];
86 [label="Enter block"];
87 [label="Variable declaration: lvar x: R|kotlin/Any?|"];
88 [label="Const: String()"];
89 [label="Assignment: R|<local>/x|"];
90 [label="Access variable R|<local>/x|"];
91 [label="Smart cast: R|<local>/x|"];
92 [label="Access variable R|kotlin/String.length|"];
subgraph cluster_29 {
color=blue
96 [label="Function call arguments enter"];
97 [label="Postponed enter to lambda"];
93 [label="Function call arguments enter"];
94 [label="Postponed enter to lambda"];
subgraph cluster_30 {
color=blue
98 [label="Enter function <anonymous>" style="filled" fillcolor=red];
95 [label="Enter function <anonymous>" style="filled" fillcolor=red];
subgraph cluster_31 {
color=blue
99 [label="Enter block"];
100 [label="Const: Int(1)"];
101 [label="Assignment: R|<local>/x|"];
102 [label="Exit block"];
96 [label="Enter block"];
97 [label="Const: Int(1)"];
98 [label="Assignment: R|<local>/x|"];
99 [label="Exit block"];
}
103 [label="Exit function <anonymous>" style="filled" fillcolor=red];
100 [label="Exit function <anonymous>" style="filled" fillcolor=red];
}
104 [label="Function call arguments exit"];
101 [label="Function call arguments exit"];
}
105 [label="Postponed exit from lambda"];
106 [label="Function call: R|/atLeastOnce|(...)" style="filled" fillcolor=yellow];
107 [label="Access variable R|<local>/x|"];
108 [label="Smart cast: R|<local>/x|"];
109 [label="Access variable <Unresolved name: length>#"];
102 [label="Postponed exit from lambda"];
103 [label="Function call: R|/atLeastOnce|(...)" style="filled" fillcolor=yellow];
104 [label="Access variable R|<local>/x|"];
105 [label="Access variable <Unresolved name: length>#"];
subgraph cluster_32 {
color=blue
110 [label="Function call arguments enter"];
111 [label="Access variable R|<local>/x|"];
112 [label="Smart cast: R|<local>/x|"];
113 [label="Function call arguments exit"];
106 [label="Function call arguments enter"];
107 [label="Access variable R|<local>/x|"];
108 [label="Function call arguments exit"];
}
114 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow];
115 [label="Exit block"];
109 [label="Function call: R|<local>/x|.<Unresolved name: inc>#()" style="filled" fillcolor=yellow];
110 [label="Exit block"];
}
116 [label="Exit function test2" style="filled" fillcolor=red];
111 [label="Exit function test2" style="filled" fillcolor=red];
}
85 -> {86};
86 -> {87};
87 -> {88};
88 -> {89};
89 -> {90};
90 -> {91};
91 -> {92};
92 -> {93};
93 -> {94};
94 -> {95};
94 -> {95 101};
94 -> {102} [style=dotted];
94 -> {95} [style=dashed];
95 -> {96};
96 -> {97};
97 -> {98 104};
97 -> {105} [style=dotted];
97 -> {98} [style=dashed];
97 -> {98};
98 -> {99};
99 -> {100};
100 -> {101};
101 -> {102};
102 -> {103};
103 -> {105};
104 -> {106};
100 -> {102};
101 -> {103};
102 -> {94} [color=green style=dashed];
102 -> {103} [label="Postponed"];
103 -> {104};
104 -> {105};
105 -> {106};
105 -> {97} [color=green style=dashed];
106 -> {107};
107 -> {108};
108 -> {109};
109 -> {110};
110 -> {111};
111 -> {112};
subgraph cluster_33 {
color=red
112 [label="Enter function test3" style="filled" fillcolor=red];
subgraph cluster_34 {
color=blue
113 [label="Enter block"];
114 [label="Variable declaration: lvar x: R|kotlin/Any?|"];
115 [label="Const: String()"];
116 [label="Assignment: R|<local>/x|"];
117 [label="Access variable R|<local>/x|"];
118 [label="Smart cast: R|<local>/x|"];
119 [label="Access variable R|kotlin/String.length|"];
subgraph cluster_35 {
color=blue
120 [label="Function call arguments enter"];
121 [label="Postponed enter to lambda"];
subgraph cluster_36 {
color=blue
122 [label="Enter function <anonymous>" style="filled" fillcolor=red];
subgraph cluster_37 {
color=blue
123 [label="Enter block"];
124 [label="Const: Int(1)"];
125 [label="Assignment: R|<local>/x|"];
126 [label="Exit block"];
}
127 [label="Exit function <anonymous>" style="filled" fillcolor=red];
}
128 [label="Function call arguments exit"];
}
129 [label="Postponed exit from lambda"];
130 [label="Function call: R|/exactlyOnce|(...)" style="filled" fillcolor=yellow];
131 [label="Access variable R|<local>/x|"];
132 [label="Access variable <Unresolved name: length>#"];
subgraph cluster_38 {
color=blue
133 [label="Function call arguments enter"];
134 [label="Access variable R|<local>/x|"];
135 [label="Function call arguments exit"];
}
136 [label="Function call: R|<local>/x|.<Unresolved name: inc>#()" style="filled" fillcolor=yellow];
137 [label="Exit block"];
}
138 [label="Exit function test3" style="filled" fillcolor=red];
}
112 -> {113};
113 -> {114};
114 -> {115};
115 -> {116};
subgraph cluster_33 {
color=red
117 [label="Enter function test3" style="filled" fillcolor=red];
subgraph cluster_34 {
color=blue
118 [label="Enter block"];
119 [label="Variable declaration: lvar x: R|kotlin/Any?|"];
120 [label="Const: String()"];
121 [label="Assignment: R|<local>/x|"];
122 [label="Access variable R|<local>/x|"];
123 [label="Smart cast: R|<local>/x|"];
124 [label="Access variable R|kotlin/String.length|"];
subgraph cluster_35 {
color=blue
125 [label="Function call arguments enter"];
126 [label="Postponed enter to lambda"];
subgraph cluster_36 {
color=blue
127 [label="Enter function <anonymous>" style="filled" fillcolor=red];
subgraph cluster_37 {
color=blue
128 [label="Enter block"];
129 [label="Const: Int(1)"];
130 [label="Assignment: R|<local>/x|"];
131 [label="Exit block"];
}
132 [label="Exit function <anonymous>" style="filled" fillcolor=red];
}
133 [label="Function call arguments exit"];
}
134 [label="Postponed exit from lambda"];
135 [label="Function call: R|/exactlyOnce|(...)" style="filled" fillcolor=yellow];
136 [label="Access variable R|<local>/x|"];
137 [label="Smart cast: R|<local>/x|"];
138 [label="Access variable <Unresolved name: length>#"];
subgraph cluster_38 {
color=blue
139 [label="Function call arguments enter"];
140 [label="Access variable R|<local>/x|"];
141 [label="Smart cast: R|<local>/x|"];
142 [label="Function call arguments exit"];
}
143 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow];
144 [label="Exit block"];
}
145 [label="Exit function test3" style="filled" fillcolor=red];
}
116 -> {117};
117 -> {118};
118 -> {119};
119 -> {120};
120 -> {121};
121 -> {122};
121 -> {122 128};
121 -> {129} [style=dotted];
121 -> {122} [style=dashed];
122 -> {123};
123 -> {124};
124 -> {125};
125 -> {126};
126 -> {127 133};
126 -> {134} [style=dotted];
126 -> {127} [style=dashed];
127 -> {128};
128 -> {129};
129 -> {130};
126 -> {127};
127 -> {129};
128 -> {130};
129 -> {130} [label="Postponed"];
130 -> {131};
131 -> {132};
132 -> {134};
133 -> {135};
132 -> {133};
133 -> {134};
134 -> {135};
135 -> {136};
136 -> {137};
137 -> {138};
138 -> {139};
subgraph cluster_39 {
color=red
139 [label="Enter function test4" style="filled" fillcolor=red];
subgraph cluster_40 {
color=blue
140 [label="Enter block"];
141 [label="Variable declaration: lvar x: R|kotlin/Any?|"];
142 [label="Const: String()"];
143 [label="Assignment: R|<local>/x|"];
144 [label="Access variable R|<local>/x|"];
145 [label="Smart cast: R|<local>/x|"];
146 [label="Access variable R|kotlin/String.length|"];
subgraph cluster_41 {
color=blue
147 [label="Function call arguments enter"];
148 [label="Postponed enter to lambda"];
subgraph cluster_42 {
color=blue
149 [label="Enter function <anonymous>" style="filled" fillcolor=red];
subgraph cluster_43 {
color=blue
150 [label="Enter block"];
151 [label="Const: Int(1)"];
152 [label="Assignment: R|<local>/x|"];
153 [label="Exit block"];
}
154 [label="Exit function <anonymous>" style="filled" fillcolor=red];
}
155 [label="Function call arguments exit"];
}
156 [label="Postponed exit from lambda"];
157 [label="Function call: R|/atMostOnce|(...)" style="filled" fillcolor=yellow];
158 [label="Access variable R|<local>/x|"];
159 [label="Access variable <Unresolved name: length>#"];
subgraph cluster_44 {
color=blue
160 [label="Function call arguments enter"];
161 [label="Access variable R|<local>/x|"];
162 [label="Function call arguments exit"];
}
163 [label="Function call: R|<local>/x|.<Unresolved name: inc>#()" style="filled" fillcolor=yellow];
164 [label="Exit block"];
}
165 [label="Exit function test4" style="filled" fillcolor=red];
}
139 -> {140};
140 -> {141};
141 -> {142};
142 -> {143};
143 -> {144};
144 -> {145};
subgraph cluster_39 {
color=red
146 [label="Enter function test4" style="filled" fillcolor=red];
subgraph cluster_40 {
color=blue
147 [label="Enter block"];
148 [label="Variable declaration: lvar x: R|kotlin/Any?|"];
149 [label="Const: String()"];
150 [label="Assignment: R|<local>/x|"];
151 [label="Access variable R|<local>/x|"];
152 [label="Smart cast: R|<local>/x|"];
153 [label="Access variable R|kotlin/String.length|"];
subgraph cluster_41 {
color=blue
154 [label="Function call arguments enter"];
155 [label="Postponed enter to lambda"];
subgraph cluster_42 {
color=blue
156 [label="Enter function <anonymous>" style="filled" fillcolor=red];
subgraph cluster_43 {
color=blue
157 [label="Enter block"];
158 [label="Const: Int(1)"];
159 [label="Assignment: R|<local>/x|"];
160 [label="Exit block"];
}
161 [label="Exit function <anonymous>" style="filled" fillcolor=red];
}
162 [label="Function call arguments exit"];
}
163 [label="Postponed exit from lambda"];
164 [label="Function call: R|/atMostOnce|(...)" style="filled" fillcolor=yellow];
165 [label="Access variable R|<local>/x|"];
166 [label="Smart cast: R|<local>/x|"];
167 [label="Access variable <Unresolved name: length>#"];
subgraph cluster_44 {
color=blue
168 [label="Function call arguments enter"];
169 [label="Access variable R|<local>/x|"];
170 [label="Smart cast: R|<local>/x|"];
171 [label="Function call arguments exit"];
}
172 [label="Function call: R|<local>/x|.<Unresolved name: inc>#()" style="filled" fillcolor=yellow];
173 [label="Exit block"];
}
174 [label="Exit function test4" style="filled" fillcolor=red];
}
145 -> {146};
146 -> {147};
147 -> {148};
148 -> {149};
148 -> {149 155 156};
148 -> {149} [style=dashed];
149 -> {150};
150 -> {151};
151 -> {152};
152 -> {153};
153 -> {154};
154 -> {155};
155 -> {156 162 163};
155 -> {156} [style=dashed];
156 -> {157};
154 -> {156};
155 -> {157};
156 -> {157} [label="Postponed"];
157 -> {158};
158 -> {159};
159 -> {160};
160 -> {161};
161 -> {163};
162 -> {164};
161 -> {162};
162 -> {163};
163 -> {164};
164 -> {165};
165 -> {166};
166 -> {167};
167 -> {168};
168 -> {169};
169 -> {170};
170 -> {171};
171 -> {172};
172 -> {173};
173 -> {174};
}
@@ -77,7 +77,7 @@ FILE: flowFromInplaceLambda3.kt
R|<local>/x| = String()
}
)
R|<local>/x|.R|kotlin/String.length|
R|<local>/x|.<Unresolved name: length>#
}
public final fun test2(): R|kotlin/Unit| {
lvar x: R|kotlin/Any?|
@@ -88,7 +88,7 @@ FILE: flowFromInplaceLambda3.kt
}
)
R|<local>/x|.<Unresolved name: length>#
R|<local>/x|.R|kotlin/Int.inc|()
R|<local>/x|.<Unresolved name: inc>#()
}
public final fun test3(): R|kotlin/Unit| {
lvar x: R|kotlin/Any?|
@@ -99,7 +99,7 @@ FILE: flowFromInplaceLambda3.kt
}
)
R|<local>/x|.<Unresolved name: length>#
R|<local>/x|.R|kotlin/Int.inc|()
R|<local>/x|.<Unresolved name: inc>#()
}
public final fun test4(): R|kotlin/Unit| {
lvar x: R|kotlin/Any?|
@@ -36,7 +36,7 @@ fun test1m() {
x = ""
x.length
unknown { x = "" }
x.length
x.<!UNRESOLVED_REFERENCE!>length<!>
}
fun test2() {
@@ -45,7 +45,7 @@ fun test2() {
x.length
atLeastOnce { x = 1 }
x.<!UNRESOLVED_REFERENCE!>length<!>
x.inc()
x.<!UNRESOLVED_REFERENCE!>inc<!>()
}
fun test3() {
@@ -54,7 +54,7 @@ fun test3() {
x.length
exactlyOnce { x = 1 }
x.<!UNRESOLVED_REFERENCE!>length<!>
x.inc()
x.<!UNRESOLVED_REFERENCE!>inc<!>()
}
fun test4() {
File diff suppressed because it is too large Load Diff
@@ -83,8 +83,8 @@ FILE: flowFromTwoInplaceLambdas.kt
^ Int(123)
}
)
R|<local>/p|.R|kotlin/String.length<Inapplicable(UNSAFE_CALL): kotlin/String.length>#|
R|<local>/p|?.{ $subj$.R|kotlin/String.length| }
R|<local>/p|.<Unresolved name: length>#
R|<local>/p|?.{ $subj$.<Unresolved name: length># }
}
public abstract interface I1 : R|kotlin/Any| {
public abstract val x: R|kotlin/Int|
@@ -110,8 +110,8 @@ FILE: flowFromTwoInplaceLambdas.kt
^ Int(123)
}
)
R|<local>/x|.R|/I1.x|
R|<local>/x|.R|/I2.y|
R|<local>/x|.<Unresolved name: x>#
R|<local>/x|.<Unresolved name: y>#
}
public final fun test5(x: R|kotlin/Any?|, q: R|kotlin/String?|): R|kotlin/Unit| {
lvar p: R|kotlin/Any?| = R|<local>/x|
@@ -125,8 +125,8 @@ FILE: flowFromTwoInplaceLambdas.kt
^ R|/n|<R|kotlin/Int?|>()
}
)
R|<local>/p|.R|kotlin/String.length<Inapplicable(UNSAFE_CALL): kotlin/String.length>#|
R|<local>/p|?.{ $subj$.R|kotlin/String.length| }
R|<local>/p|.<Unresolved name: length>#
R|<local>/p|?.{ $subj$.<Unresolved name: length># }
}
public final fun test6(): R|kotlin/Unit| {
lval x: R|kotlin/String|
@@ -47,8 +47,8 @@ fun test3(x: Any?) {
var p: Any? = x
p.<!UNRESOLVED_REFERENCE!>length<!> // Bad
run2({ p = null; n() }, { p = ""; 123 })
p<!UNSAFE_CALL!>.<!>length // Bad: p can be null
p?.length // OK: p is String | Nothing? = String?
p.<!UNRESOLVED_REFERENCE!>length<!> // Bad: p can be null
p?.<!UNRESOLVED_REFERENCE!>length<!> // Bad: KT-37838 -> OK: p is String | Nothing? = String?
}
interface I1 { val x: Int }
@@ -61,16 +61,16 @@ fun test4(x: Any?) {
{ x as I1; x.<!UNRESOLVED_REFERENCE!>y<!>; n() }, // Bad: may or may not be called first
{ x as I2; x.<!UNRESOLVED_REFERENCE!>x<!>; 123 } // Bad: may or may not be called first
)
x.x // OK: x is I1 & I2
x.y // OK: x is I1 & I2
x.<!UNRESOLVED_REFERENCE!>x<!> // Bad: KT-37838 -> OK: x is I1 & I2
x.<!UNRESOLVED_REFERENCE!>y<!> // Bad: KT-37838 -> OK: x is I1 & I2
}
fun test5(x: Any?, q: String?) {
var p: Any? = x
p.<!UNRESOLVED_REFERENCE!>length<!> // Bad
run2({ p as Int; 123 }, { p = q; n() })
p<!UNSAFE_CALL!>.<!>length // Bad: p is String? | (String? & Int) = String?
p?.length // OK: p is String?
p.<!UNRESOLVED_REFERENCE!>length<!> // Bad: p is String? | (String? & Int) = String?
p?.<!UNRESOLVED_REFERENCE!>length<!> // Bad: KT-37838 -> OK: p is String?
}
fun test6() {
@@ -98,7 +98,7 @@ digraph initBlockAndInPlaceLambda_kt {
21 -> {22};
22 -> {24};
23 -> {25};
24 -> {25};
24 -> {25} [label="Postponed"];
25 -> {26};
26 -> {27};
27 -> {28};
@@ -128,7 +128,7 @@ digraph inplaceLambdaInControlFlowExpressions_kt {
34 -> {36};
35 -> {37};
36 -> {37} [color=green];
36 -> {40} [color=red];
36 -> {40} [color=red label="Postponed"];
37 -> {38};
38 -> {39};
39 -> {40};
@@ -216,7 +216,7 @@ digraph inplaceLambdaInControlFlowExpressions_kt {
57 -> {59};
58 -> {60};
59 -> {60} [color=green];
59 -> {69} [color=red];
59 -> {69} [color=red label="Postponed"];
60 -> {61};
61 -> {62};
62 -> {63 69};
@@ -281,7 +281,7 @@ digraph inplaceLambdaInControlFlowExpressions_kt {
83 -> {85};
84 -> {86};
85 -> {86} [color=green];
85 -> {87} [color=red];
85 -> {87} [color=red label="Postponed"];
86 -> {87};
87 -> {88};
88 -> {89};
+1 -1
View File
@@ -478,8 +478,8 @@ digraph jumps_kt {
154 -> {155} [style=dotted];
155 -> {157};
156 -> {158};
157 -> {158};
157 -> {149} [color=green style=dashed];
157 -> {158} [label="Postponed"];
158 -> {159};
159 -> {160};
@@ -77,7 +77,7 @@ digraph lambdaAsReturnOfLambda_kt {
16 -> {17} [style=dotted];
17 -> {18} [style=dotted];
19 -> {21};
20 -> {21};
20 -> {21} [label="Postponed"];
21 -> {22};
22 -> {23} [color=green];
@@ -132,7 +132,7 @@ digraph lambdaReturningObject_kt {
33 -> {34};
35 -> {37};
36 -> {37} [color=green];
36 -> {39} [color=red];
36 -> {39} [color=red label="Postponed"];
37 -> {38};
38 -> {39};
39 -> {40};
@@ -112,8 +112,8 @@ digraph lambdas_kt {
28 -> {29};
29 -> {31};
30 -> {32};
31 -> {32};
31 -> {20} [color=green style=dashed];
31 -> {32} [label="Postponed"];
32 -> {33};
33 -> {34};
34 -> {35};
@@ -276,8 +276,8 @@ digraph lambdas_kt {
83 -> {84} [style=dotted];
84 -> {86} [style=dotted];
85 -> {87};
86 -> {87};
86 -> {77} [color=green style=dashed];
86 -> {87} [label="Postponed"];
87 -> {88};
88 -> {91};
88 -> {89} [style=dotted];
@@ -334,8 +334,8 @@ digraph lambdas_kt {
101 -> {102} [style=dotted];
102 -> {104} [style=dotted];
103 -> {105};
104 -> {105};
104 -> {95} [color=green style=dashed];
104 -> {105} [label="Postponed"];
105 -> {106};
106 -> {109};
106 -> {107} [style=dotted];
@@ -447,8 +447,8 @@ digraph localClassesWithImplicit_kt {
58 -> {59};
59 -> {61};
60 -> {62};
61 -> {62};
61 -> {47} [color=green style=dashed];
61 -> {62} [label="Postponed"];
62 -> {63};
63 -> {66};
63 -> {64} [style=dotted];
@@ -490,8 +490,8 @@ digraph localClassesWithImplicit_kt {
99 -> {100};
100 -> {102};
101 -> {103};
102 -> {103};
102 -> {70} [color=green style=dashed];
102 -> {103} [label="Postponed"];
103 -> {104};
104 -> {107};
104 -> {105} [style=dotted];
@@ -531,8 +531,8 @@ digraph localClassesWithImplicit_kt {
134 -> {135};
135 -> {137};
136 -> {138};
137 -> {138};
137 -> {123} [color=green style=dashed];
137 -> {138} [label="Postponed"];
138 -> {139};
139 -> {142};
139 -> {140} [style=dotted];
@@ -574,8 +574,8 @@ digraph localClassesWithImplicit_kt {
175 -> {176};
176 -> {178};
177 -> {179};
178 -> {179};
178 -> {146} [color=green style=dashed];
178 -> {179} [label="Postponed"];
179 -> {180};
180 -> {183};
180 -> {181} [style=dotted];
@@ -100,7 +100,7 @@ digraph postponedLambdaInConstructor_kt {
24 -> {26};
25 -> {27};
26 -> {27} [color=green];
26 -> {28} [color=red];
26 -> {28} [color=red label="Postponed"];
27 -> {28};
28 -> {29};
29 -> {30} [color=green];
@@ -231,7 +231,7 @@ digraph postponedLambdaInReturn_kt {
67 -> {68} [style=dotted];
68 -> {70};
69 -> {71};
70 -> {71};
70 -> {71} [label="Postponed"];
71 -> {72};
72 -> {73};
73 -> {74};
@@ -402,7 +402,7 @@ digraph postponedLambdaInReturn_kt {
121 -> {122} [style=dotted];
122 -> {124};
123 -> {125};
124 -> {125};
124 -> {125} [label="Postponed"];
125 -> {126};
126 -> {127};
127 -> {128};
@@ -565,7 +565,7 @@ digraph postponedLambdaInReturn_kt {
176 -> {177} [style=dotted];
177 -> {179};
178 -> {180};
179 -> {180};
179 -> {180} [label="Postponed"];
180 -> {181};
181 -> {182};
182 -> {183};
@@ -67,7 +67,7 @@ digraph postponedLambdas_kt {
14 -> {15};
15 -> {16};
17 -> {19};
18 -> {19};
18 -> {19} [label="Postponed"];
19 -> {20};
20 -> {21};
@@ -212,8 +212,8 @@ digraph propertiesAndInitBlocks_kt {
48 -> {49} [style=dotted];
49 -> {50} [style=dotted];
51 -> {53};
52 -> {53};
52 -> {9} [color=green style=dashed];
52 -> {53} [label="Postponed"];
53 -> {54};
54 -> {55} [color=green];
55 -> {56};
@@ -145,7 +145,7 @@ digraph returnValuesFromLambda_kt {
38 -> {39};
39 -> {41};
40 -> {42};
41 -> {42};
41 -> {42} [label="Postponed"];
42 -> {43};
43 -> {44};
44 -> {45};
@@ -204,7 +204,7 @@ digraph returnValuesFromLambda_kt {
57 -> {58} [style=dotted];
58 -> {60};
59 -> {61};
60 -> {61};
60 -> {61} [label="Postponed"];
61 -> {62};
62 -> {63};
63 -> {64};
@@ -255,7 +255,7 @@ digraph returnValuesFromLambda_kt {
73 -> {74} [style=dotted];
74 -> {76} [style=dotted];
75 -> {77} [style=dotted];
76 -> {77} [style=dotted];
76 -> {77} [style=dotted label="Postponed"];
77 -> {78} [style=dotted];
78 -> {79} [style=dotted];
79 -> {80} [style=dotted];