[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:
Vendored
+4
-4
@@ -84,8 +84,8 @@ digraph singleReturnFromTry_kt {
|
||||
20 -> {21} [style=dotted];
|
||||
21 -> {23} [style=dotted];
|
||||
22 -> {24};
|
||||
23 -> {24};
|
||||
23 -> {14} [color=green style=dashed];
|
||||
23 -> {24} [label="Postponed"];
|
||||
24 -> {25} [style=dotted];
|
||||
25 -> {26} [style=dotted];
|
||||
26 -> {27} [style=dotted];
|
||||
@@ -225,7 +225,7 @@ digraph singleReturnFromTry_kt {
|
||||
59 -> {61};
|
||||
60 -> {51} [color=green style=dashed];
|
||||
60 -> {61} [color=green];
|
||||
60 -> {69} [style=dotted];
|
||||
60 -> {69} [style=dotted label="Postponed"];
|
||||
61 -> {62} [style=dotted];
|
||||
62 -> {63} [style=dotted];
|
||||
63 -> {64} [style=dotted];
|
||||
@@ -321,8 +321,8 @@ digraph singleReturnFromTry_kt {
|
||||
91 -> {92} [style=dotted];
|
||||
92 -> {94} [style=dotted];
|
||||
93 -> {95};
|
||||
94 -> {95};
|
||||
94 -> {75} [color=green style=dashed];
|
||||
94 -> {95} [label="Postponed"];
|
||||
95 -> {96} [style=dotted];
|
||||
96 -> {97} [style=dotted];
|
||||
97 -> {98} [style=dotted];
|
||||
@@ -416,7 +416,7 @@ digraph singleReturnFromTry_kt {
|
||||
113 -> {115};
|
||||
114 -> {105} [color=green style=dashed];
|
||||
114 -> {115} [color=green];
|
||||
114 -> {129} [color=red];
|
||||
114 -> {129} [color=red label="Postponed"];
|
||||
115 -> {116} [style=dotted];
|
||||
116 -> {117} [style=dotted];
|
||||
117 -> {118} [style=dotted];
|
||||
|
||||
+2
-2
@@ -135,7 +135,7 @@ digraph delegatedConstructorArguments_kt {
|
||||
12 -> {14};
|
||||
13 -> {6} [color=green style=dashed];
|
||||
13 -> {14} [color=green];
|
||||
13 -> {15} [color=red];
|
||||
13 -> {15} [color=red label="Postponed"];
|
||||
14 -> {15};
|
||||
15 -> {30} [color=green label="return@/Test.Test"];
|
||||
15 -> {45} [color=red];
|
||||
@@ -153,7 +153,7 @@ digraph delegatedConstructorArguments_kt {
|
||||
26 -> {28};
|
||||
27 -> {20} [color=green style=dashed];
|
||||
27 -> {28} [color=green];
|
||||
27 -> {29} [color=red];
|
||||
27 -> {29} [color=red label="Postponed"];
|
||||
28 -> {29};
|
||||
29 -> {30} [color=green label="return@/Test.Test"];
|
||||
29 -> {55} [color=red];
|
||||
|
||||
+1
-1
@@ -467,7 +467,7 @@ digraph smartCastInCatch_fir_kt {
|
||||
148 -> {150};
|
||||
149 -> {151};
|
||||
150 -> {151} [color=green];
|
||||
150 -> {163} [color=red];
|
||||
150 -> {163} [color=red label="Postponed"];
|
||||
151 -> {152};
|
||||
152 -> {153};
|
||||
153 -> {154 163};
|
||||
|
||||
+1
-1
@@ -1062,7 +1062,7 @@ digraph castInTryWithJump_fir_kt {
|
||||
344 -> {345} [style=dotted];
|
||||
345 -> {347} [style=dotted];
|
||||
346 -> {348} [style=dotted];
|
||||
347 -> {348} [style=dotted];
|
||||
347 -> {348} [style=dotted label="Postponed"];
|
||||
348 -> {349} [style=dotted];
|
||||
349 -> {350} [style=dotted];
|
||||
350 -> {351} [style=dotted];
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@ fun foo(arg: Int?) {
|
||||
x.hashCode()
|
||||
x = null
|
||||
}
|
||||
if (<!SENSELESS_COMPARISON!>x != null<!>) x = 42
|
||||
if (x != null) x = 42
|
||||
// Unsafe because of lambda
|
||||
x<!UNSAFE_CALL!>.<!>hashCode()
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -10,13 +10,13 @@ fun testSafeCaptureVarInInitializer() {
|
||||
|
||||
val s = when (val y = run { x = 42; 32 }) {
|
||||
0 -> {
|
||||
x.inc() // TODO fix smart casts for captured variables
|
||||
x<!UNSAFE_CALL!>.<!>inc() // TODO fix smart casts for captured variables
|
||||
"0"
|
||||
}
|
||||
else -> "!= 0"
|
||||
}
|
||||
|
||||
x.inc() // TODO fix smart casts for captured variables
|
||||
x<!UNSAFE_CALL!>.<!>inc() // TODO fix smart casts for captured variables
|
||||
}
|
||||
|
||||
|
||||
|
||||
-48
@@ -1,48 +0,0 @@
|
||||
// !LANGUAGE: +VariableDeclarationInWhenSubject
|
||||
|
||||
fun foo(s1: Int, s2: Int) = s1 + s2
|
||||
|
||||
fun test1(x: String?) =
|
||||
when (val y = x?.length) {
|
||||
null -> 0
|
||||
else -> foo(x.length, y)
|
||||
}
|
||||
|
||||
fun test2(x: String?) {
|
||||
when (val y = run { x!! }) {
|
||||
"foo" -> x.length
|
||||
"bar" -> y.length
|
||||
}
|
||||
}
|
||||
|
||||
fun test3(x: String?, y: String?) {
|
||||
when (val z = x ?: y!!) {
|
||||
"foo" -> x<!UNSAFE_CALL!>.<!>length
|
||||
"bar" -> y<!UNSAFE_CALL!>.<!>length
|
||||
"baz" -> z.length
|
||||
}
|
||||
}
|
||||
|
||||
fun <T> id(x: T): T = x
|
||||
|
||||
fun test4(x: String?) {
|
||||
when (val y = id(x!!)) {
|
||||
"foo" -> x.length
|
||||
"bar" -> y.length
|
||||
}
|
||||
}
|
||||
|
||||
class Inv<T>(val data: T)
|
||||
|
||||
fun test5(x: Inv<out Any?>) {
|
||||
when (val y = x.data) {
|
||||
is String -> y.length // should be ok
|
||||
null -> x.data.<!UNRESOLVED_REFERENCE!>length<!> // should be error
|
||||
}
|
||||
}
|
||||
|
||||
fun test6(x: Inv<out String?>) {
|
||||
when (val y = x.data) {
|
||||
is String -> x.data.length // should be ok
|
||||
}
|
||||
}
|
||||
+6
-4
@@ -1,11 +1,13 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +VariableDeclarationInWhenSubject
|
||||
// DIAGNOSTICS: -DEBUG_INFO_SMARTCAST
|
||||
|
||||
fun foo(s1: Int, s2: Int) = s1 + s2
|
||||
|
||||
fun test1(x: String?) =
|
||||
when (val y = x?.length) {
|
||||
null -> 0
|
||||
else -> foo(<!DEBUG_INFO_SMARTCAST!>x<!>.length, <!DEBUG_INFO_SMARTCAST!>y<!>)
|
||||
else -> foo(x.length, y)
|
||||
}
|
||||
|
||||
fun test2(x: String?) {
|
||||
@@ -27,7 +29,7 @@ fun <T> id(x: T): T = x
|
||||
|
||||
fun test4(x: String?) {
|
||||
when (val y = id(x!!)) {
|
||||
"foo" -> <!DEBUG_INFO_SMARTCAST!>x<!>.length
|
||||
"foo" -> x.length
|
||||
"bar" -> y.length
|
||||
}
|
||||
}
|
||||
@@ -36,13 +38,13 @@ class Inv<T>(val data: T)
|
||||
|
||||
fun test5(x: Inv<out Any?>) {
|
||||
when (val y = x.data) {
|
||||
is String -> <!DEBUG_INFO_SMARTCAST!>y<!>.length // should be ok
|
||||
is String -> y.length // should be ok
|
||||
null -> x.data.<!UNRESOLVED_REFERENCE!>length<!> // should be error
|
||||
}
|
||||
}
|
||||
|
||||
fun test6(x: Inv<out String?>) {
|
||||
when (val y = x.data) {
|
||||
is String -> <!DEBUG_INFO_SMARTCAST!>x.data<!>.length // should be ok
|
||||
is String -> x.data.length // should be ok
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user