9 lines
233 B
Kotlin
Vendored
9 lines
233 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 (x.length == 0) break
|
|
} while (true)
|
|
return x.length
|
|
} |