Skip to content

Commit 8b8fc17

Browse files
committed
test that #1856 is fixed.
1 parent 1822623 commit 8b8fc17

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

tests/run/i1856.check

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Iteration 0
2+
Iteration 1
3+
Iteration 2
4+
Iteration 3
5+
Iteration 4
6+
Iteration 5
7+
Iteration 6
8+
Iteration 7
9+
Iteration 8
10+
Iteration 9
11+
42
12+

tests/run/i1856.scala

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
object Test {
2+
var count: Int = 0
3+
lazy val lzy: Int = {
4+
if (count < 10) {
5+
println(s"Iteration $count")
6+
count += 1
7+
lzy
8+
} else 42
9+
}
10+
11+
def main(args: Array[String]): Unit = {
12+
println(lzy)
13+
}
14+
}

0 commit comments

Comments
 (0)