FIR checker: warn unnecessary non-null assertions
This commit is contained in:
committed by
Mikhail Glukhikh
parent
5229d4e4f4
commit
2ecb6733ed
Vendored
+1
-1
@@ -55,7 +55,7 @@ fun case_1(value_1: Int?) {
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
fun case_2(value_1: Int?) {
|
||||
if (!contracts.case_2(value_1)!!) {
|
||||
if (!contracts.case_2(value_1)<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>) {
|
||||
value_1<!UNSAFE_CALL!>.<!>inv()
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -159,6 +159,6 @@ class case_10_class {
|
||||
*/
|
||||
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?)
|
||||
println(value_1!!.length)
|
||||
println(value_1<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length)
|
||||
println(value_2?.toByte())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user