FIR checker: warn unnecessary non-null assertions
This commit is contained in:
committed by
Mikhail Glukhikh
parent
5229d4e4f4
commit
2ecb6733ed
@@ -3,7 +3,7 @@ fun main() {
|
||||
if (b != null) {
|
||||
if (!b) {} // OK
|
||||
if (b) {} // Error: Condition must be of type kotlin.Boolean, but is of type kotlin.Boolean?
|
||||
if (b!!) {} // WARN: Unnecessary non-null assertion (!!) on a non-null receiver of type kotlin.Boolean?
|
||||
if (b<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>) {} // WARN: Unnecessary non-null assertion (!!) on a non-null receiver of type kotlin.Boolean?
|
||||
foo(b) // OK
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user