mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
Kotlin: Add test for NullMaybe query
This commit is contained in:
@@ -0,0 +1 @@
|
||||
| Test.kt:6:13:6:13 | d | Variable $@ may be null here because of $@ assignment. | Test.kt:2:5:2:25 | Double d | d | Test.kt:2:5:2:25 | d | this |
|
||||
@@ -0,0 +1 @@
|
||||
Likely Bugs/Nullness/NullMaybe.ql
|
||||
7
java/ql/test/kotlin/query-tests/NullMaybe/Test.kt
Normal file
7
java/ql/test/kotlin/query-tests/NullMaybe/Test.kt
Normal file
@@ -0,0 +1,7 @@
|
||||
fun fn(b: Boolean) {
|
||||
var d: Double? = null
|
||||
if (b) {
|
||||
d = 1.0
|
||||
}
|
||||
println(d!!)
|
||||
}
|
||||
Reference in New Issue
Block a user