aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2015-07-27 12:22:21 +1000
committerJason Zaugg <jzaugg@gmail.com>2015-07-27 13:03:48 +1000
commita037da192dbea32cffa8c5c8d33e7c56af0c353f (patch)
tree209fb3d4338978bdf7f46c2bf08d6e2787c6aabd /src
parentf6a5c93acb7628c4d169b778e386332c6d1bd99b (diff)
downloadscala-async-a037da192dbea32cffa8c5c8d33e7c56af0c353f.tar.gz
scala-async-a037da192dbea32cffa8c5c8d33e7c56af0c353f.tar.bz2
scala-async-a037da192dbea32cffa8c5c8d33e7c56af0c353f.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/main/scala/scala/async/internal/AnfTransform.scala2
1 files changed, 1 insertions, 1 deletions
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)