diff options
author | Gene Novark <gnovark@gmail.com> | 2014-12-09 17:15:40 -0500 |
---|---|---|
committer | Gene Novark <gnovark@gmail.com> | 2014-12-09 17:15:40 -0500 |
commit | 13bc13dfe78667f6a14352daebea524a2809d078 (patch) | |
tree | 04e77a135318944d7010e53dc3149d477b713c93 /src/test | |
parent | 38416aec4cbe5b47153ae5f634e420bc00b2292d (diff) | |
download | scala-async-13bc13dfe78667f6a14352daebea524a2809d078.tar.gz scala-async-13bc13dfe78667f6a14352daebea524a2809d078.tar.bz2 scala-async-13bc13dfe78667f6a14352daebea524a2809d078.zip |
Fix regression around await of non-class type
E.g. type param, abstrat type.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/scala/scala/async/run/toughtype/ToughType.scala | 15 |
1 files changed, 15 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 9ae33b1..c4d6c80 100644 --- a/src/test/scala/scala/async/run/toughtype/ToughType.scala +++ b/src/test/scala/scala/async/run/toughtype/ToughType.scala @@ -304,6 +304,21 @@ class ToughTypeSpec { val result = Await.result(fut, 5.seconds) result mustBe None } + + @Test def awaitOfAbstractType(): Unit = { + import ExecutionContext.Implicits.global + + def combine[A](a1: A, a2: A): A = a1 + + def combineAsync[A](a1: Future[A], a2: Future[A]) = async { + combine(await(a1), await(a2)) + } + + val fut = combineAsync(Future(1), Future(2)) + + val result = Await.result(fut, 5.seconds) + result mustEqual 1 + } } class IntWrapper(val value: String) extends AnyVal { |