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
@@ -127,7 +127,7 @@ FILE: flowFromInplaceLambda2.kt
|
||||
^ R|/n|<R|kotlin/Nothing?|>()
|
||||
}
|
||||
)), Int(1), R|kotlin/run|<R|kotlin/Int|>(<L> = run@fun <anonymous>(): R|kotlin/Int| <inline=Inline, kind=EXACTLY_ONCE> {
|
||||
R|<local>/p|.R|kotlin/String.length|
|
||||
R|<local>/p|.<Inapplicable(UNSTABLE_SMARTCAST): kotlin/String.length>#
|
||||
^ Int(123)
|
||||
}
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user