diff options
author | Tiark Rompf <tiark.rompf@epfl.ch> | 2011-08-23 11:14:53 +0000 |
---|---|---|
committer | Tiark Rompf <tiark.rompf@epfl.ch> | 2011-08-23 11:14:53 +0000 |
commit | a93134b4832e95ff014f162f4cc8667f8136cb7d (patch) | |
tree | 384e33218c272f647d1fa1ad94e87b0d94c05768 /test | |
parent | 80952759fbaaf3a99f6bc0ca528da726b5a438e7 (diff) | |
download | scala-a93134b4832e95ff014f162f4cc8667f8136cb7d.tar.gz scala-a93134b4832e95ff014f162f4cc8667f8136cb7d.tar.bz2 scala-a93134b4832e95ff014f162f4cc8667f8136cb7d.zip |
applying patch provided by Topher, fixes #3501.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/continuations-run/t3501.check | 5 | ||||
-rw-r--r-- | test/files/continuations-run/t3501.scala | 15 |
2 files changed, 20 insertions, 0 deletions
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) + } + } +} |