FIR checker: warn useless as and is
This commit is contained in:
committed by
TeamCityServer
parent
19d939c36e
commit
e2dc21da90
@@ -13,7 +13,7 @@ fun f2(s: Number?) {
|
||||
}
|
||||
|
||||
fun f3(s: Number?) {
|
||||
if (s is Int && s as Int == 42);
|
||||
if (s is Int && s <!USELESS_CAST!>as Int<!> == 42);
|
||||
checkSubtype<Int>(<!ARGUMENT_TYPE_MISMATCH!>s<!>)
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
fun foo(o: Any) {
|
||||
if (o is String) {
|
||||
val s = o as String
|
||||
val s = o <!USELESS_CAST!>as String<!>
|
||||
s.length
|
||||
}
|
||||
}
|
||||
@@ -13,4 +13,4 @@ fun foo1(o: Any) {
|
||||
val s = o
|
||||
s.length
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user