Files
codeql/java/ql/test-kotlin1/query-tests/UselessNullCheck/Test.kt
Owen Mansel-Chan a4bf2b8f58 Fix 3 tests
2026-06-11 22:59:39 +02:00

19 lines
313 B
Kotlin

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() // $ Alert
o.toString()
}
}