diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/scala/scala/async/run/match0/Match0.scala | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/scala/scala/async/run/match0/Match0.scala b/src/test/scala/scala/async/run/match0/Match0.scala index 49a3a69..7c392ab 100644 --- a/src/test/scala/scala/async/run/match0/Match0.scala +++ b/src/test/scala/scala/async/run/match0/Match0.scala @@ -125,4 +125,25 @@ class MatchSpec { } m4("") mustBe 0 } + + @Test def bugCastBoxedUnitToStringMatch() { + import scala.async.internal.AsyncId.{async, await} + def foo = async { + val p2 = await(5) + "foo" match { + case p3: String => + p2.toString + } + } + foo mustBe "5" + } + + @Test def bugCastBoxedUnitToStringIf() { + import scala.async.internal.AsyncId.{async, await} + def foo = async { + val p2 = await(5) + if (true) p2.toString else p2.toString + } + foo mustBe "5" + } } |