File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
main/scala/scala/async/internal
test/scala/scala/async/run/toughtype Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -343,9 +343,8 @@ private[async] trait TransformUtils {
343343 New (TypeTree (baseType)))), tpSym.asClass.primaryConstructor)
344344
345345 val zero = gen.mkMethodCall(target, argZero :: Nil )
346-
347346 // restore the original type which we might otherwise have weakened with `baseType` above
348- gen.mkCast(zero, tp)
347+ c.typecheck(atMacroPos( gen.mkCast(zero, tp)) )
349348 } else {
350349 gen.mkZero(tp)
351350 }
Original file line number Diff line number Diff line change @@ -319,6 +319,19 @@ class ToughTypeSpec {
319319 val result = Await .result(fut, 5 .seconds)
320320 result mustEqual 1
321321 }
322+
323+ // https://github.com/scala/async/issues/106
324+ @ Test def valueClassT106 (): Unit = {
325+ import scala .async .internal .AsyncId ._
326+ async {
327+ " whatever value" match {
328+ case _ =>
329+ await(" whatever return type" )
330+ new IntWrapper (" value class matters" )
331+ }
332+ " whatever return type"
333+ }
334+ }
322335}
323336
324337class IntWrapper (val value : String ) extends AnyVal {
You can’t perform that action at this time.
0 commit comments