Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/varnotnull/capturedInClosureOff.kt
T
2017-08-16 12:34:04 +03:00

16 lines
268 B
Kotlin
Vendored

// !LANGUAGE: -CapturedInClosureSmartCasts
fun run(f: () -> Unit) = f()
fun foo(s: String?) {
var x: String? = null
if (s != null) {
x = s
}
if (x != null) {
run {
<!SMARTCAST_IMPOSSIBLE!>x<!>.hashCode()
}
}
}