Skip to content

Commit a037da1

Browse files
committed
Avoid leaking untyped trees out of macro
The stack trace and bisection in scala#119 made me notice that we are failing to typecheck the cast we generated in the fix for scala#74. The ticket doesn't have a reproduction, so I'm submitting this without a test case. Fixes scala#119
1 parent f6a5c93 commit a037da1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/scala/scala/async/internal/AnfTransform.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ private[async] trait AnfTransform {
5959
// TODO avoid creating a ValDef for the result of this await to avoid this tree shape altogether.
6060
// This will require some deeper changes to the later parts of the macro which currently assume regular
6161
// tree structure around `await` calls.
62-
gen.mkCast(ref, definitions.UnitTpe)
62+
api.typecheck(atPos(tree.pos)(gen.mkCast(ref, definitions.UnitTpe)))
6363
else ref
6464
stats :+ valDef :+ atPos(tree.pos)(ref1)
6565

0 commit comments

Comments
 (0)