KT-5182 Data flow info is lost for 'when' branches

#KT-5158 Fixed
  #KT-4332 Fixed
This commit is contained in:
Svetlana Isakova
2014-06-06 13:55:24 +04:00
parent cb788579ba
commit 68b4b8e946
7 changed files with 68 additions and 6 deletions
@@ -0,0 +1,13 @@
//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_AUTOCAST!>a<!>.foo() //'foo' is unresolved, smart cast doesn't work
else -> <!DEBUG_INFO_AUTOCAST!>a<!>.foo()
}