summaryrefslogtreecommitdiff
path: root/test/files/continuations-run/t3225.scala
diff options
context:
space:
mode:
authorTiark Rompf <tiark.rompf@epfl.ch>2010-03-29 09:55:44 +0000
committerTiark Rompf <tiark.rompf@epfl.ch>2010-03-29 09:55:44 +0000
commitf500aeb1fda09b3d0c142da1307694ab4dacc883 (patch)
treecbcc5857c4222fe11e5eb8bb81379d45069c9bbe /test/files/continuations-run/t3225.scala
parent59da69b707e2e79fbaad4aae7fc347ca1b66a34b (diff)
downloadscala-f500aeb1fda09b3d0c142da1307694ab4dacc883.tar.gz
scala-f500aeb1fda09b3d0c142da1307694ab4dacc883.tar.bz2
scala-f500aeb1fda09b3d0c142da1307694ab4dacc883.zip
closes 2864.
Diffstat (limited to 'test/files/continuations-run/t3225.scala')
-rw-r--r--test/files/continuations-run/t3225.scala56
1 files changed, 56 insertions, 0 deletions
diff --git a/test/files/continuations-run/t3225.scala b/test/files/continuations-run/t3225.scala
new file mode 100644
index 0000000000..ecfde279cf
--- /dev/null
+++ b/test/files/continuations-run/t3225.scala
@@ -0,0 +1,56 @@
+// $Id$
+
+import scala.util.continuations._
+
+
+object Test {
+
+ class Bla {
+ val x = 8
+ def y[T] = 9
+ }
+
+/*
+ def bla[A] = shift { k:(Bla=>A) => k(new Bla) }
+*/
+
+ def bla1 = shift { k:(Bla=>Bla) => k(new Bla) }
+ def bla2 = shift { k:(Bla=>Int) => k(new Bla) }
+
+ def fooA = bla2.x
+ def fooB[T] = bla2.y[T]
+
+ def testMono() = {
+ println(reset(bla1).x)
+ println(reset(bla2.x))
+ println(reset(bla2.y[Int]))
+ println(reset(bla2.y))
+ println(reset(fooA))
+ println(reset(fooB))
+ 0
+ }
+
+ def blaX[A] = shift { k:(Bla=>A) => k(new Bla) }
+
+ def fooX[A] = blaX[A].x
+ def fooY[A] = blaX[A].y[A]
+
+ def testPoly() = {
+ println(reset(blaX[Bla]).x)
+ println(reset(blaX[Int].x))
+ println(reset(blaX[Int].y[Int]))
+ println(reset(blaX[Int].y))
+ println(reset(fooX[Int]))
+ println(reset(fooY[Int]))
+ 0
+ }
+
+
+ // TODO: check whether this also applies to a::shift { k => ... }
+
+ def main(args: Array[String]) = {
+ testMono()
+ testPoly()
+ }
+
+}