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
@@ -20,26 +20,26 @@ import libModule.*
// TESTCASE NUMBER: 1
fun case1() {
val res = JavaClass.FALSE!!
val res = JavaClass.FALSE<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
}
// TESTCASE NUMBER: 2
fun case2() {
val x = JavaClass.obj!!
val x = JavaClass.obj<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
}
// TESTCASE NUMBER: 3
fun case3() {
val a = false
val x = a!!
val x = a<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
}
// TESTCASE NUMBER: 4
fun case4() {
val x = "weds"!!
val x = "weds"<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
}
// TESTCASE NUMBER: 5
fun case5(nothing: Nothing) {
val y = nothing!!
val y = nothing<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
}