From a93134b4832e95ff014f162f4cc8667f8136cb7d Mon Sep 17 00:00:00 2001 From: Tiark Rompf Date: Tue, 23 Aug 2011 11:14:53 +0000 Subject: applying patch provided by Topher, fixes #3501. --- test/files/continuations-run/t3501.check | 5 +++++ test/files/continuations-run/t3501.scala | 15 +++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 test/files/continuations-run/t3501.check create mode 100644 test/files/continuations-run/t3501.scala (limited to 'test') diff --git a/test/files/continuations-run/t3501.check b/test/files/continuations-run/t3501.check new file mode 100644 index 0000000000..08adcfe27a --- /dev/null +++ b/test/files/continuations-run/t3501.check @@ -0,0 +1,5 @@ +42 +42 +42 +42 +42 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) + } + } +} -- cgit v1.2.3