Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/loops/ifBreakAssignInsideWhileTrue.fir.kt
T
2020-06-19 15:53:09 +03:00

11 lines
299 B
Kotlin
Vendored

public fun foo(x: String?): Int {
var y: Any
while (true) {
y = if (x == null) break else x
}
// In future we can infer this initialization
<!UNINITIALIZED_VARIABLE!>y<!>.hashCode()
// x is null because of the break
return x.<!INAPPLICABLE_CANDIDATE!>length<!>
}