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()
22
33fun fn1 () {
44 var c = true
5- while (c) {
5+ while (c) { // TODO: false positive
66 fn0 {
77 c = false
88 }
99 }
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+ }
1024}
Original file line number Diff line number Diff line change 11| 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