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

12 lines
255 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_PARAMETER
fun run(f: () -> Unit) = 0
fun foo(arg: Int?) {
var x = arg
if (x == null) return
run {
// Not safe: x = null later in the owner
<!SMARTCAST_IMPOSSIBLE!>x<!>.hashCode()
}
x = null
}