diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-07-21 19:13:53 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-07-21 19:15:56 +0200 |
commit | e44ab5215d2d48ac47b296ac27d395c38407bc35 (patch) | |
tree | 9065df2c33d34a7a3c92c09c4ee73904f6d0e0cd /src/test | |
parent | 5342427303c1e91aeb0cd82007dcac4fb4249c9e (diff) | |
download | scala-async-e44ab5215d2d48ac47b296ac27d395c38407bc35.tar.gz scala-async-e44ab5215d2d48ac47b296ac27d395c38407bc35.tar.bz2 scala-async-e44ab5215d2d48ac47b296ac27d395c38407bc35.zip |
Test case for already-fixed NPE with value classes
This progressed along with the fix for #66.
`TreeGen.mkZero` is a bit of a minefield: first with `Nothing` and
now with Value Classes. I wonder if we can provoke the same sort of
bug in the compiler in places where this is used.
Closes #83
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/scala/scala/async/run/toughtype/ToughType.scala | 14 |
1 files changed, 14 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 54a53c8..5ff1605 100644 --- a/src/test/scala/scala/async/run/toughtype/ToughType.scala +++ b/src/test/scala/scala/async/run/toughtype/ToughType.scala @@ -228,8 +228,22 @@ class ToughTypeSpec { case `e` => } } + + @Test def ticket83ValueClass() { + import scala.async.Async._ + import scala.concurrent._, duration._, ExecutionContext.Implicits.global + val f = async { + val uid = new IntWrapper("foo") + await(Future(uid)) + } + val result = Await.result(f, 5.seconds) + result mustEqual (new IntWrapper("foo")) + } } +class IntWrapper(val value: String) extends AnyVal + + trait A trait B |