File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
java/ql/test/kotlin/query-tests/ConstantLoopCondition Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -2,9 +2,23 @@ fun fn0(f: Function0<Unit>) = f()
2
2
3
3
fun fn1 () {
4
4
var c = true
5
- while (c) {
5
+ while (c) { // TODO: false positive
6
6
fn0 {
7
7
c = false
8
8
}
9
9
}
10
+
11
+ var d = true
12
+ while (d) {
13
+ fn0 {
14
+ println (d)
15
+ }
16
+ }
17
+
18
+ val e = true
19
+ while (e) {
20
+ fn0 {
21
+ println (e)
22
+ }
23
+ }
10
24
}
Original file line number Diff line number Diff line change 1
1
| A.kt:5:12:5:12 | c | $@ might not terminate, as this loop condition is constant within the loop. | A.kt:5:5:9:5 | while (...) | Loop |
2
+ | A.kt:12:12:12:12 | d | $@ might not terminate, as this loop condition is constant within the loop. | A.kt:12:5:16:5 | while (...) | Loop |
3
+ | A.kt:19:12:19:12 | e | $@ might not terminate, as this loop condition is constant within the loop. | A.kt:19:5:23:5 | while (...) | Loop |
You can’t perform that action at this time.
0 commit comments