diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-06-14 12:51:24 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-06-14 12:51:24 +0200 |
commit | f9eb27daf750010556d49dd1411ac2433ac29f17 (patch) | |
tree | 6d6d46f72918c25c3d9357aabfe5e43a97d40d45 /src/test/scala | |
parent | f77d11962a3bf73c813a42a05e842ce710588c3f (diff) | |
download | scala-async-f9eb27daf750010556d49dd1411ac2433ac29f17.tar.gz scala-async-f9eb27daf750010556d49dd1411ac2433ac29f17.tar.bz2 scala-async-f9eb27daf750010556d49dd1411ac2433ac29f17.zip |
Avoid NotImplementedError awaiting a Future[Nothing]
`gen.mkZero(NothingTpe)` gives the tree `Predef.???`. Instead, we should leave
the `await` field uninitialized with `ValDef(..., rhs = EmptyTree)`.
Fixes #66
Diffstat (limited to 'src/test/scala')
-rw-r--r-- | src/test/scala/scala/async/run/toughtype/ToughType.scala | 16 |
1 files changed, 16 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 458157c..54a53c8 100644 --- a/src/test/scala/scala/async/run/toughtype/ToughType.scala +++ b/src/test/scala/scala/async/run/toughtype/ToughType.scala @@ -211,6 +211,22 @@ class ToughTypeSpec { }(SomeExecutionContext) } } + + } + + @Test def ticket66Nothing() { + import scala.concurrent.Future + import scala.concurrent.ExecutionContext.Implicits.global + val e = new Exception() + val f: Future[Nothing] = Future.failed(e) + val f1 = async { + await(f) + } + try { + Await.result(f1, 5.seconds) + } catch { + case `e` => + } } } |