Files
kotlin-fork/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/While.fir.kt
T
Dmitriy Novozhilov 6735cc8937 [FIR] Implement new bound smartcast algorithm
#KT-36055 Fixed
2020-02-12 10:17:45 +03:00

23 lines
421 B
Kotlin
Vendored

fun bar(x: Int): Int = x + 1
fun foo() {
val x: Int? = null
while (x == null) {
<!INAPPLICABLE_CANDIDATE!>bar<!>(x)
}
bar(x)
val y: Int? = null
while (y != null) {
bar(y)
}
<!INAPPLICABLE_CANDIDATE!>bar<!>(y)
val z: Int? = null
while (z == null) {
<!INAPPLICABLE_CANDIDATE!>bar<!>(z)
break
}
<!INAPPLICABLE_CANDIDATE!>bar<!>(z)
}