diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-07-07 07:37:53 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-07-07 07:37:53 +1000 |
commit | c60c38ca6098402f7a9cc6d6746b664bb2b1306c (patch) | |
tree | bc31d4de6cdda7bfe4358984a40095c2e7464eac /src/test/scala/scala/async/run/toughtype/ToughType.scala | |
parent | 82232ec47effb4a6b67b3a0792e1c7600e2d31b7 (diff) | |
download | scala-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.scala | 32 |
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 + } } |