From e44ab5215d2d48ac47b296ac27d395c38407bc35 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Mon, 21 Jul 2014 19:13:53 +0200 Subject: 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 --- src/test/scala/scala/async/run/toughtype/ToughType.scala | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 -- cgit v1.2.3