Skip to content

Commit 53123cc

Browse files
committed
Merge pull request #85 from retronym/ticket/83
Test case for already-fixed NPE with value classes
2 parents 5342427 + e44ab52 commit 53123cc

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/test/scala/scala/async/run/toughtype/ToughType.scala

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,22 @@ class ToughTypeSpec {
228228
case `e` =>
229229
}
230230
}
231+
232+
@Test def ticket83ValueClass() {
233+
import scala.async.Async._
234+
import scala.concurrent._, duration._, ExecutionContext.Implicits.global
235+
val f = async {
236+
val uid = new IntWrapper("foo")
237+
await(Future(uid))
238+
}
239+
val result = Await.result(f, 5.seconds)
240+
result mustEqual (new IntWrapper("foo"))
241+
}
231242
}
232243

244+
class IntWrapper(val value: String) extends AnyVal
245+
246+
233247
trait A
234248

235249
trait B

0 commit comments

Comments
 (0)