Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/kt30826.kt
T
pyos 526e46cffc FIR: fix some errors in local variable assignment analyzer
* wrong method was called from FirDataFlowAnalyzer.exitFunctionCall;
 * map from function to affected properties should be keyed by symbol,
   not FirFunction, as the latter may change;
 * arguments of `return` and assignment statements should be visited,
   as they may contain lambdas.
2022-06-10 09:43:48 +03:00

19 lines
277 B
Kotlin
Vendored

// FIR_IDENTICAL
// Issue: KT-30826
interface I1
interface I2 {
fun foo() {}
}
class A : I1, I2
fun foo(x: I1?) {
var y = x
y as I2
val bar = {
<!SMARTCAST_IMPOSSIBLE!>y<!>.foo() // NPE in NI, smartcast impossible in OI
}
y = null
bar()
}