Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/loops/elvisInsideDoWhile.kt
T
2015-10-14 20:39:35 +03:00

9 lines
287 B
Kotlin
Vendored

public fun foo(x: String?): Int {
do {
// After the check, smart cast should work
x ?: x!!.length
// x is not null in both branches
if (<!DEBUG_INFO_SMARTCAST!>x<!>.length == 0) break
} while (true)
return <!DEBUG_INFO_SMARTCAST!>x<!>.length
}