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:51:12 +1000 |
commit | 953414f53691ee4e0d9a34d304a0ebef60ce68f6 (patch) | |
tree | d2ca0ffb68a7a502a40c31e427157e451d29a90a /src/test/scala/scala/async/run/toughtype/ToughType.scala | |
parent | 9da0183d3932a432da312cce29184aaac788facb (diff) | |
download | scala-async-953414f53691ee4e0d9a34d304a0ebef60ce68f6.tar.gz scala-async-953414f53691ee4e0d9a34d304a0ebef60ce68f6.tar.bz2 scala-async-953414f53691ee4e0d9a34d304a0ebef60ce68f6.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`.
(cherry picked from commit f4275e22e000541eb619808723b70bd64b9b4873)
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 0f56ae0..ec59399 100644 --- a/src/test/scala/scala/async/run/toughtype/ToughType.scala +++ b/src/test/scala/scala/async/run/toughtype/ToughType.scala @@ -286,6 +286,19 @@ class ToughTypeSpec { val result = Await.result(fut, 5.seconds) result mustBe None } + + // 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 { |