Files
kotlin-fork/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/WhenIn.kt
T
2015-04-29 16:33:24 +02:00

16 lines
342 B
Kotlin
Vendored

// !CHECK_TYPE
fun foo(x: Int, list: List<Int>?) {
when (x) {
in list!! -> checkSubtype<List<Int>>(<!DEBUG_INFO_SMARTCAST!>list<!>)
else -> {}
}
}
fun whenWithoutSubject(x: Int, list: List<Int>?) {
when {
x in list!! -> checkSubtype<List<Int>>(<!DEBUG_INFO_SMARTCAST!>list<!>)
else -> {}
}
}