FIR checker: warn useless as and is

This commit is contained in:
Jinseong Jeon
2021-04-28 22:32:51 -07:00
committed by TeamCityServer
parent 19d939c36e
commit e2dc21da90
141 changed files with 417 additions and 543 deletions
@@ -14,7 +14,7 @@ fun g(a: SomeClass?) {
a.hashCode()
a.foo
(a as? SomeSubClass)<!UNSAFE_CALL!>.<!>foo
(a as SomeSubClass).foo
(a <!USELESS_CAST!>as SomeSubClass<!>).foo
}
val b = (a as? SomeSubClass)?.foo
if (b != null) {
@@ -22,7 +22,7 @@ fun g(a: SomeClass?) {
a.hashCode()
a.foo
(a as? SomeSubClass)<!UNSAFE_CALL!>.<!>foo
(a as SomeSubClass).foo
(a <!USELESS_CAST!>as SomeSubClass<!>).foo
}
val c = a as? SomeSubClass
if (c != null) {
@@ -33,4 +33,4 @@ fun g(a: SomeClass?) {
c.hashCode()
c.foo
}
}
}