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

13 lines
286 B
Kotlin
Vendored

//KT-5182 Data flow info is lost for 'when' branches
open class A
class B: A() {
fun foo() = 1
}
fun foo(a: A) = when {
a !is B -> 2
true -> <!DEBUG_INFO_SMARTCAST!>a<!>.foo() //'foo' is unresolved, smart cast doesn't work
else -> <!DEBUG_INFO_SMARTCAST!>a<!>.foo()
}