Files
kotlin-fork/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/WhenEntryAs.kt
T
2014-10-01 18:52:52 +04:00

25 lines
516 B
Kotlin

fun foo(x: Number, y: Int) {
when (x) {
x as Int -> <!DEBUG_INFO_SMARTCAST!>x<!> : Int
y -> {}
else -> {}
}
<!DEBUG_INFO_SMARTCAST!>x<!> : Int
}
fun bar(x: Number) {
when (x) {
x as Int -> <!DEBUG_INFO_SMARTCAST!>x<!> : Int
else -> {}
}
<!DEBUG_INFO_SMARTCAST!>x<!> : Int
}
fun whenWithoutSubject(x: Number) {
when {
(x as Int) == 42 -> <!DEBUG_INFO_SMARTCAST!>x<!> : Int
else -> {}
}
<!DEBUG_INFO_SMARTCAST!>x<!> : Int
}