From a037da192dbea32cffa8c5c8d33e7c56af0c353f Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Mon, 27 Jul 2015 12:22:21 +1000 Subject: Avoid leaking untyped trees out of macro The stack trace and bisection in #119 made me notice that we are failing to typecheck the cast we generated in the fix for #74. The ticket doesn't have a reproduction, so I'm submitting this without a test case. Fixes #119 --- src/main/scala/scala/async/internal/AnfTransform.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/scala/scala/async/internal/AnfTransform.scala b/src/main/scala/scala/async/internal/AnfTransform.scala index 585f388..b0774e3 100644 --- a/src/main/scala/scala/async/internal/AnfTransform.scala +++ b/src/main/scala/scala/async/internal/AnfTransform.scala @@ -59,7 +59,7 @@ private[async] trait AnfTransform { // TODO avoid creating a ValDef for the result of this await to avoid this tree shape altogether. // This will require some deeper changes to the later parts of the macro which currently assume regular // tree structure around `await` calls. - gen.mkCast(ref, definitions.UnitTpe) + api.typecheck(atPos(tree.pos)(gen.mkCast(ref, definitions.UnitTpe))) else ref stats :+ valDef :+ atPos(tree.pos)(ref1) -- cgit v1.2.3