KT-6118 Redundant type cast can be not redundant?

#KT-6118 Fixed
This commit is contained in:
Andrey Breslav
2015-02-16 14:38:34 +03:00
parent 47f772e75a
commit 54483dbb95
14 changed files with 178 additions and 2 deletions
@@ -0,0 +1,15 @@
fun test(a: Any?, flag: Boolean, x: Any?) {
if (a !is String) return
<!DEBUG_INFO_SMARTCAST!>a<!>.length()
val b: Any?
if (flag) {
b = a
<!DEBUG_INFO_SMARTCAST!>b<!>.length()
}
else {
b = x
b.<!UNRESOLVED_REFERENCE!>length<!>()
}
}