More correct calculation of smart casts in smart completion

This commit is contained in:
Valentin Kipyatkov
2015-08-12 19:46:59 +03:00
parent f3e7560593
commit b21226ac1c
3 changed files with 53 additions and 6 deletions
@@ -0,0 +1,21 @@
open class A(val v1: Any?, val v2: Any?, val v3: Any?)
class B(v1: Any?, v2: Any?, v3: Any?, val v4: Any?) : A(v1, v2, v3)
class C(val c: Any?) {
fun B.foo() {
fun A.bar() {
if (this@foo.v1 is String && this@bar.v2 is String && this.v3 is String && this@foo.v4 is String && this@C.c is String) {
f(<caret>)
}
}
}
}
fun f(s: String){}
// ABSENT: v1
// EXIST: v2
// EXIST: v3
// EXIST: v4
// EXIST: c