don't report USELESS_CAST in case of casting to superype using 'as'

This commit is contained in:
Dmitry Jemerov
2015-04-24 16:18:54 +02:00
parent f374eec8f1
commit 8258d72e23
4 changed files with 37 additions and 8 deletions
@@ -13,16 +13,16 @@ class B: A()
fun test(a: Any?) {
if (a is B) {
(a <!USELESS_CAST!>as A<!>).foo()
(a as A).foo()
}
}
fun test1(a: B) {
(a <!USELESS_CAST!>as A?<!>)?.foo()
(a as A?)?.foo()
}
fun test2(b: B?) {
if (b != null) {
(b <!USELESS_CAST!>as A<!>).foo()
(b as A).foo()
}
}