Skip to content

Commit e44ab52

Browse files
committed
Test case for already-fixed NPE with value classes
This progressed along with the fix for scala#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 scala#83
1 parent 5342427 commit e44ab52

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)