diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-08-07 09:57:28 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-08-07 09:57:28 +0200 |
commit | d676e55d4a4047aca57ca4491759010bd186f038 (patch) | |
tree | fed2d8a00a4c71810d55e2da038960c20e92f189 /src/main/scala | |
parent | 2c3a81ca101e103c1defa5e34aaeefa096911c0b (diff) | |
download | scala-async-d676e55d4a4047aca57ca4491759010bd186f038.tar.gz scala-async-d676e55d4a4047aca57ca4491759010bd186f038.tar.bz2 scala-async-d676e55d4a4047aca57ca4491759010bd186f038.zip |
Set the type of case bodies to Unit after ANF.
Avoids runtime errors like: "java.lang.Double cannot be cast to scala.runtime.BoxedUnit"
Diffstat (limited to 'src/main/scala')
-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 d98aaa3..13218f3 100644 --- a/src/main/scala/scala/async/internal/AnfTransform.scala +++ b/src/main/scala/scala/async/internal/AnfTransform.scala @@ -107,7 +107,7 @@ private[async] trait AnfTransform { case b@Block(caseStats, caseExpr) => treeCopy.Block(b, caseStats, typedAssign(caseExpr)) case _ => typedAssign(body) } - treeCopy.CaseDef(cd, pat, guard, newBody).setType(definitions.UnitTpe) + treeCopy.CaseDef(cd, pat, guard, newBody.setType(definitions.UnitTpe)).setType(definitions.UnitTpe) } val matchWithAssign = treeCopy.Match(tree, scrut, casesWithAssign).setType(definitions.UnitTpe) require(matchWithAssign.tpe != null, matchWithAssign) |