Fix false warning about useless cast in property and property accessor

Note that there are some other problems, for example:
`val a = if (true) 1 as Number else 2`, here we'll get useless cast

 #KT-9551 Fixed
 #KT-9645 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2017-04-05 04:59:16 +03:00
parent 12db3a263e
commit 13eddba1f2
7 changed files with 36 additions and 3 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ fun test() : Unit {
checkSubtype<Int?>(x <!USELESS_CAST!>as? Int?<!>)
checkSubtype<Int?>(y as? Int?)
val <!UNUSED_VARIABLE!>s<!> = "" <!USELESS_CAST!>as Any<!>
val <!UNUSED_VARIABLE!>s<!> = "" as Any
("" as String?)?.length
(data@("" as String?))?.length
(<!WRONG_ANNOTATION_TARGET!>@MustBeDocumented()<!>( "" as String?))?.length