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

9 lines
301 B
Kotlin
Vendored

public fun foo(x: String?, y: String?): Int {
while (true) {
(if (x != null) break else y) ?: y!!
// y is not null in both branches but it's hard to determine
y<!UNSAFE_CALL!>.<!>length
}
// y can be null because of the break
return y<!UNSAFE_CALL!>.<!>length
}