mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
Kotlin: Add a Kotlin 2 copy of the testsuite
This commit is contained in:
24
java/ql/test-kotlin2/query-tests/ConstantLoopCondition/A.kt
Normal file
24
java/ql/test-kotlin2/query-tests/ConstantLoopCondition/A.kt
Normal file
@@ -0,0 +1,24 @@
|
||||
fun fn0(f: Function0<Unit>) = f()
|
||||
|
||||
fun fn1() {
|
||||
var c = true
|
||||
while (c) { // TODO: false positive
|
||||
fn0 {
|
||||
c = false
|
||||
}
|
||||
}
|
||||
|
||||
var d = true
|
||||
while (d) {
|
||||
fn0 {
|
||||
println(d)
|
||||
}
|
||||
}
|
||||
|
||||
val e = true
|
||||
while (e) {
|
||||
fn0 {
|
||||
println(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user