summaryrefslogtreecommitdiff
path: root/test/files/continuations-run/t3501.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/continuations-run/t3501.scala')
-rw-r--r--test/files/continuations-run/t3501.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/files/continuations-run/t3501.scala b/test/files/continuations-run/t3501.scala
new file mode 100644
index 0000000000..c43b3322be
--- /dev/null
+++ b/test/files/continuations-run/t3501.scala
@@ -0,0 +1,15 @@
+import scala.util.continuations._
+
+object Test {
+ def capture(): Int @suspendable = 42
+
+ def main(args: Array[String]): Unit = reset {
+ var i = 0
+ while (i < 5) {
+ i += 1
+ val y = capture()
+ val s = y
+ println(s)
+ }
+ }
+}