Prefer stable types to diagnose useless cast

#KT-11622 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2017-04-05 05:47:34 +03:00
parent 13eddba1f2
commit f518e8ebb8
7 changed files with 64 additions and 25 deletions
+2 -2
View File
@@ -8,11 +8,11 @@ fun test() : Unit {
checkSubtype<Int>(y)
checkSubtype<Int>(x as Int)
checkSubtype<Int>(y <!USELESS_CAST!>as Int<!>)
checkSubtype<Int?>(x <!USELESS_CAST!>as Int?<!>)
checkSubtype<Int?>(x as Int?)
checkSubtype<Int?>(y as Int?)
checkSubtype<Int?>(x <!USELESS_CAST!>as? Int<!>)
checkSubtype<Int?>(y <!USELESS_CAST!>as? Int<!>)
checkSubtype<Int?>(x <!USELESS_CAST!>as? Int?<!>)
checkSubtype<Int?>(x as? Int?)
checkSubtype<Int?>(y as? Int?)
val <!UNUSED_VARIABLE!>s<!> = "" as Any