FIR checker: warn unnecessary non-null assertions

This commit is contained in:
Jinseong Jeon
2021-04-01 11:44:47 -07:00
committed by Mikhail Glukhikh
parent 5229d4e4f4
commit 2ecb6733ed
72 changed files with 268 additions and 246 deletions
@@ -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()
}
}
@@ -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())
}