Support smart casts for functions of local variable delegates

This commit is contained in:
Alexander Udalov
2016-06-27 18:38:25 +03:00
parent 70a994b135
commit 4a05c749b5
5 changed files with 82 additions and 28 deletions
@@ -0,0 +1,15 @@
// !DIAGNOSTICS: -UNUSED_VARIABLE
interface A {
operator fun getValue(x: Any?, y: Any?): Any?
}
interface B : A {
override fun getValue(x: Any?, y: Any?): Int
}
fun test(a: A) {
if (a is B) {
val x: Int by <!DEBUG_INFO_SMARTCAST!>a<!>
}
}