FIR CFG: check lambda concurrency by data flow, not control flow
var p: String? = something
if (p != null) {
foo(
run { p = null; n() },
// This lambda executes strictly after the one above by CFG,
// but data flow for type inference comes from before the call
// so p would get smartcasted if not forbidden.
run { p.length; 123 }
)
}
This commit is contained in:
+1
-1
@@ -870,7 +870,7 @@ digraph flowFromInplaceLambda2_kt {
|
||||
color=blue
|
||||
325 [label="Enter block"];
|
||||
326 [label="Access variable R|<local>/p|"];
|
||||
327 [label="Access variable R|kotlin/String.length|"];
|
||||
327 [label="Access variable <Inapplicable(UNSTABLE_SMARTCAST): kotlin/String.length>#"];
|
||||
328 [label="Const: Int(123)"];
|
||||
329 [label="Exit block"];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user