File tree 2 files changed +14
-2
lines changed
main/scala/scala/async/internal
test/scala/scala/async/run/toughtype
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 {
343
343
New (TypeTree (baseType)))), tpSym.asClass.primaryConstructor)
344
344
345
345
val zero = gen.mkMethodCall(target, argZero :: Nil )
346
-
347
346
// 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)) )
349
348
} else {
350
349
gen.mkZero(tp)
351
350
}
Original file line number Diff line number Diff line change @@ -319,6 +319,19 @@ class ToughTypeSpec {
319
319
val result = Await .result(fut, 5 .seconds)
320
320
result mustEqual 1
321
321
}
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
+ }
322
335
}
323
336
324
337
class IntWrapper (val value : String ) extends AnyVal {
You can’t perform that action at this time.
0 commit comments