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
@@ -43,7 +43,7 @@ fun case_2(value: Any) {
// TESTCASE NUMBER: 3
fun case_3(value: String?) {
if (!value.isNullOrEmpty() is Boolean) {
if (<!USELESS_IS_CHECK!>!value.isNullOrEmpty() is Boolean<!>) {
value<!UNSAFE_CALL!>.<!>length
}
}
@@ -158,7 +158,7 @@ class case_10_class {
* ISSUES: KT-26747
*/
fun case_11(value_1: Any?, value_2: Any?, value_3: Any?) {
funWithReturnsAndInvertCondition(value_1 !is String || value_2 !is Number || value_3 !is Any?)
funWithReturnsAndInvertCondition(value_1 !is String || value_2 !is Number || <!USELESS_IS_CHECK!>value_3 !is Any?<!>)
println(value_1<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length)
println(value_2<!UNNECESSARY_SAFE_CALL!>?.<!>toByte())
}