aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/scala/async/run/toughtype/ToughType.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-07-07 07:37:53 +1000
committerJason Zaugg <jzaugg@gmail.com>2013-07-07 07:37:53 +1000
commitc60c38ca6098402f7a9cc6d6746b664bb2b1306c (patch)
treebc31d4de6cdda7bfe4358984a40095c2e7464eac /src/test/scala/scala/async/run/toughtype/ToughType.scala
parent82232ec47effb4a6b67b3a0792e1c7600e2d31b7 (diff)
downloadscala-async-c60c38ca6098402f7a9cc6d6746b664bb2b1306c.tar.gz
scala-async-c60c38ca6098402f7a9cc6d6746b664bb2b1306c.tar.bz2
scala-async-c60c38ca6098402f7a9cc6d6746b664bb2b1306c.zip
Fix another interation with existentials and a name clash.
Diffstat (limited to 'src/test/scala/scala/async/run/toughtype/ToughType.scala')
-rw-r--r--src/test/scala/scala/async/run/toughtype/ToughType.scala32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/test/scala/scala/async/run/toughtype/ToughType.scala b/src/test/scala/scala/async/run/toughtype/ToughType.scala
index 6fcd966..2737132 100644
--- a/src/test/scala/scala/async/run/toughtype/ToughType.scala
+++ b/src/test/scala/scala/async/run/toughtype/ToughType.scala
@@ -105,4 +105,36 @@ class ToughTypeSpec {
await(foo(new a.B))
}
}
+
+ @Test def existentialMatch() {
+ import scala.async.AsyncId.{async, await}
+ trait Container[+A]
+ case class ContainerImpl[A](value: A) extends Container[A]
+ def foo: Container[_] = async {
+ val a: Any = List(1)
+ a match {
+ case buf: Seq[_] =>
+ val foo = await(5)
+ val e0 = buf(0)
+ ContainerImpl(e0)
+ }
+ }
+ foo
+ }
+
+ @Test def existentialIfElse0() {
+ import scala.async.AsyncId.{async, await}
+ trait Container[+A]
+ case class ContainerImpl[A](value: A) extends Container[A]
+ def foo: Container[_] = async {
+ val a: Any = List(1)
+ if (true) {
+ val buf: Seq[_] = List(1)
+ val foo = await(5)
+ val e0 = buf(0)
+ ContainerImpl(e0)
+ } else ???
+ }
+ foo
+ }
}