Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/localClassChanges.kt
T

16 lines
344 B
Kotlin
Vendored

fun trans(n: Int, f: () -> Boolean) = if (f()) n else null
fun foo() {
var i: Int? = 5
if (i != null) {
class Changing {
fun bar() {
i = null
}
}
<!SMARTCAST_IMPOSSIBLE!>i<!>.hashCode()
Changing().bar()
<!SMARTCAST_IMPOSSIBLE!>i<!>.hashCode()
}
}