diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2015-07-06 12:23:52 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2015-07-06 12:23:52 +1000 |
commit | f4275e22e000541eb619808723b70bd64b9b4873 (patch) | |
tree | 9eb2e5c2a77ad875a082c5076f0b92bd7cae08f2 /src/test/scala/scala/async/run/toughtype/ToughType.scala | |
parent | 1568a28842e2c538ca735a34274ae5e4ee5eca22 (diff) | |
download | scala-async-f4275e22e000541eb619808723b70bd64b9b4873.tar.gz scala-async-f4275e22e000541eb619808723b70bd64b9b4873.tar.bz2 scala-async-f4275e22e000541eb619808723b70bd64b9b4873.zip |
Fix compiler crash with value class in result position
We were leaking untyped trees out of the macro, which crashed
in refchecks.
This commit proactively typechecks the tree returned by `mkZero`.
Diffstat (limited to 'src/test/scala/scala/async/run/toughtype/ToughType.scala')
-rw-r--r-- | src/test/scala/scala/async/run/toughtype/ToughType.scala | 13 |
1 files changed, 13 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 c4d6c80..33c839e 100644 --- a/src/test/scala/scala/async/run/toughtype/ToughType.scala +++ b/src/test/scala/scala/async/run/toughtype/ToughType.scala @@ -319,6 +319,19 @@ class ToughTypeSpec { val result = Await.result(fut, 5.seconds) result mustEqual 1 } + + // https://github.com/scala/async/issues/106 + @Test def valueClassT106(): Unit = { + import scala.async.internal.AsyncId._ + async { + "whatever value" match { + case _ => + await("whatever return type") + new IntWrapper("value class matters") + } + "whatever return type" + } + } } class IntWrapper(val value: String) extends AnyVal { |