KT-10483 Missing smart cast on variable in variable as function call

#KT-10483 Fixed
This commit is contained in:
Stanislav Erokhin
2015-12-23 17:48:42 +03:00
parent 4de26bed93
commit 3d44471659
4 changed files with 51 additions and 1 deletions
@@ -0,0 +1,17 @@
interface A
class B : A {
operator fun invoke() = this
}
class C : A
operator fun C.invoke(): B = B()
fun foo(arg: A): B? {
if (arg is B) return <!DEBUG_INFO_SMARTCAST!>arg<!>()
if (arg is C) return <!DEBUG_INFO_SMARTCAST!>arg<!>()
return null
}