Skip to content

Commit 0bc5741

Browse files
committed
Kotlin: Add FP test case for constant loop condition
1 parent 643cfce commit 0bc5741

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
fun fn0(f: Function0<Unit>) = f()
2+
3+
fun fn1() {
4+
var c = true
5+
while (c) {
6+
fn0 {
7+
c = false
8+
}
9+
}
10+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +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 |
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Likely Bugs/Termination/ConstantLoopCondition.ql

0 commit comments

Comments
 (0)