From 848d98a89e4ff25f2d1373021bef23059ff04ab2 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Fri, 23 Nov 2012 12:15:05 +0100 Subject: Convert null check to an assert. We seem to be symful now. --- src/main/scala/scala/async/AsyncAnalysis.scala | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/main/scala/scala/async/AsyncAnalysis.scala b/src/main/scala/scala/async/AsyncAnalysis.scala index c7db44d..180e006 100644 --- a/src/main/scala/scala/async/AsyncAnalysis.scala +++ b/src/main/scala/scala/async/AsyncAnalysis.scala @@ -92,12 +92,11 @@ private[async] final class AsyncAnalysis[C <: Context](override val c: C) extend if (isAwait(vd.rhs)) valDefsToLift += vd case as: Assign => if (isAwait(as.rhs)) { + assert(as.symbol != null, "internal error: null symbol for Assign tree:" + as) + // TODO test the orElse case, try to remove the restriction. - if (as.symbol != null) { - // synthetic added by the ANF transfor - val (vd, defBlockId) = valDefChunkId.getOrElse(as.symbol, c.abort(as.pos, "await may only be assigned to a var/val defined in the async block. " + as.symbol)) - valDefsToLift += vd - } + val (vd, defBlockId) = valDefChunkId.getOrElse(as.symbol, c.abort(as.pos, "await may only be assigned to a var/val defined in the async block. " + as.symbol)) + valDefsToLift += vd } super.traverse(tree) case rt: RefTree => -- cgit v1.2.3