diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2015-07-27 12:22:21 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2015-07-27 14:18:54 +1000 |
commit | 48ede0d254ee1ea03a51c4a53fe5e8d6ae3b335d (patch) | |
tree | 602cbc3ecaa0dad95d8b4504edee896742fa0cbc | |
parent | ad6c3c0a758c50ce32656e64714a0bd90a28d0be (diff) | |
download | scala-async-48ede0d254ee1ea03a51c4a53fe5e8d6ae3b335d.tar.gz scala-async-48ede0d254ee1ea03a51c4a53fe5e8d6ae3b335d.tar.bz2 scala-async-48ede0d254ee1ea03a51c4a53fe5e8d6ae3b335d.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
(cherry picked from commit a037da192dbea32cffa8c5c8d33e7c56af0c353f)
-rw-r--r-- | src/main/scala/scala/async/internal/AnfTransform.scala | 2 |
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 3c8c837..9bc36d8 100644 --- a/src/main/scala/scala/async/internal/AnfTransform.scala +++ b/src/main/scala/scala/async/internal/AnfTransform.scala @@ -81,7 +81,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) + localTyper.typedPos(tree.pos)(gen.mkCast(ref, definitions.UnitTpe)) else ref stats :+ valDef :+ atPos(tree.pos)(ref1) |