Kotlin: Add a Kotlin 2 copy of the testsuite

This commit is contained in:
Ian Lynagh
2023-10-26 13:13:28 +01:00
parent e6f31c965e
commit 905583e00a
625 changed files with 32808 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
fun fn(x:Any?, y: Any?) {
if (x == null && y == null) {
throw Exception()
}
if (x != null) {
println("x not null")
} else if (y != null) {
println("y not null")
}
}
fun fn0(o: Any?) {
if (o != null) {
o?.toString()
o.toString()
}
}

View File

@@ -0,0 +1 @@
| Test.kt:15:12:15:21 | ... (value equals) ... | This check is useless. $@ cannot be null at this check, since it is guarded by $@. | Test.kt:15:9:15:9 | tmp0_safe_receiver | tmp0_safe_receiver | Test.kt:14:9:14:17 | ... (value not-equals) ... | ... (value not-equals) ... |

View File

@@ -0,0 +1 @@
Language Abuse/UselessNullCheck.ql