diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2012-11-23 12:15:05 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2012-11-23 12:15:05 +0100 |
commit | 848d98a89e4ff25f2d1373021bef23059ff04ab2 (patch) | |
tree | 2723cb26151004f5f2db141285daa6b3200745bf /src/main/scala | |
parent | 5a2acf110233669e1cf1124ac54b28a526d37858 (diff) | |
download | scala-async-848d98a89e4ff25f2d1373021bef23059ff04ab2.tar.gz scala-async-848d98a89e4ff25f2d1373021bef23059ff04ab2.tar.bz2 scala-async-848d98a89e4ff25f2d1373021bef23059ff04ab2.zip |
Convert null check to an assert.
We seem to be symful now.
Diffstat (limited to 'src/main/scala')
-rw-r--r-- | src/main/scala/scala/async/AsyncAnalysis.scala | 9 |
1 files changed, 4 insertions, 5 deletions
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 => |