FIR: report UNSAFE_CALL on dot when possible
This commit is contained in:
+8
-8
@@ -8,13 +8,13 @@ fun test_1(b: Boolean?) {
|
||||
if ((b == true) == true) {
|
||||
b.not() // OK
|
||||
} else {
|
||||
b.<!UNSAFE_CALL{LT}!><!UNSAFE_CALL{PSI}!>not<!>()<!> // Bad
|
||||
b<!UNSAFE_CALL!>.<!>not() // Bad
|
||||
}
|
||||
}
|
||||
|
||||
fun test_2(b: Boolean?) {
|
||||
if ((b == true) != true) {
|
||||
b.<!UNSAFE_CALL{LT}!><!UNSAFE_CALL{PSI}!>not<!>()<!> // Bad
|
||||
b<!UNSAFE_CALL!>.<!>not() // Bad
|
||||
} else {
|
||||
b.not() // OK
|
||||
}
|
||||
@@ -22,7 +22,7 @@ fun test_2(b: Boolean?) {
|
||||
|
||||
fun test_3(b: Boolean?) {
|
||||
if ((b == true) == false) {
|
||||
b.<!UNSAFE_CALL{LT}!><!UNSAFE_CALL{PSI}!>not<!>()<!> // Bad
|
||||
b<!UNSAFE_CALL!>.<!>not() // Bad
|
||||
} else {
|
||||
b.not() // OK
|
||||
}
|
||||
@@ -32,13 +32,13 @@ fun test_4(b: Boolean?) {
|
||||
if ((b == true) != false) {
|
||||
b.not() // OK
|
||||
} else {
|
||||
b.<!UNSAFE_CALL{LT}!><!UNSAFE_CALL{PSI}!>not<!>()<!> // Bad
|
||||
b<!UNSAFE_CALL!>.<!>not() // Bad
|
||||
}
|
||||
}
|
||||
|
||||
fun test_5(b: Boolean?) {
|
||||
if ((b != true) == true) {
|
||||
b.<!UNSAFE_CALL{LT}!><!UNSAFE_CALL{PSI}!>not<!>()<!> // Bad
|
||||
b<!UNSAFE_CALL!>.<!>not() // Bad
|
||||
} else {
|
||||
b.not() // OK
|
||||
}
|
||||
@@ -48,7 +48,7 @@ fun test_6(b: Boolean?) {
|
||||
if ((b != true) != true) {
|
||||
b.not() // OK
|
||||
} else {
|
||||
b.<!UNSAFE_CALL{LT}!><!UNSAFE_CALL{PSI}!>not<!>()<!> // Bad
|
||||
b<!UNSAFE_CALL!>.<!>not() // Bad
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,13 +56,13 @@ fun test_7(b: Boolean?) {
|
||||
if ((b != true) == false) {
|
||||
b.not() // OK
|
||||
} else {
|
||||
b.<!UNSAFE_CALL{LT}!><!UNSAFE_CALL{PSI}!>not<!>()<!> // Bad
|
||||
b<!UNSAFE_CALL!>.<!>not() // Bad
|
||||
}
|
||||
}
|
||||
|
||||
fun test_8(b: Boolean?) {
|
||||
if ((b != true) != false) {
|
||||
b.<!UNSAFE_CALL{LT}!><!UNSAFE_CALL{PSI}!>not<!>()<!> // Bad
|
||||
b<!UNSAFE_CALL!>.<!>not() // Bad
|
||||
} else {
|
||||
b.not() // OK
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user