diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2012-11-21 21:13:07 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2012-11-21 22:35:07 +0100 |
commit | eeb0f5e676e8d9cc44ab886a6225da62dfb5d561 (patch) | |
tree | eda54581b9ffb83877b42dd8be4f72f4280094ed /src/main/scala | |
parent | bc9d1b29206c493db90b5148a646a3e16a2984ab (diff) | |
download | scala-async-eeb0f5e676e8d9cc44ab886a6225da62dfb5d561.tar.gz scala-async-eeb0f5e676e8d9cc44ab886a6225da62dfb5d561.tar.bz2 scala-async-eeb0f5e676e8d9cc44ab886a6225da62dfb5d561.zip |
Slight simplification of in-flight type checking.
Diffstat (limited to 'src/main/scala')
-rw-r--r-- | src/main/scala/scala/async/AnfTransform.scala | 3 | ||||
-rw-r--r-- | src/main/scala/scala/async/Async.scala | 10 |
2 files changed, 6 insertions, 7 deletions
diff --git a/src/main/scala/scala/async/AnfTransform.scala b/src/main/scala/scala/async/AnfTransform.scala index f29d6a1..74f7211 100644 --- a/src/main/scala/scala/async/AnfTransform.scala +++ b/src/main/scala/scala/async/AnfTransform.scala @@ -77,8 +77,7 @@ class AnfTransform[C <: Context](override val c: C) extends TransformUtils(c) { val thenStats :+ thenExpr = inline.transformToList(thenp) val elseStats :+ elseExpr = inline.transformToList(elsep) stats :+ - c.typeCheck(If(expr, Block(thenStats, thenExpr), Block(elseStats, elseExpr)), - lub(List(thenp.tpe, elsep.tpe))) + c.typeCheck(If(expr, Block(thenStats, thenExpr), Block(elseStats, elseExpr))) //TODO case Literal(_) | Ident(_) | This(_) | Match(_, _) | New(_) | Function(_, _) => List(tree) diff --git a/src/main/scala/scala/async/Async.scala b/src/main/scala/scala/async/Async.scala index f53e863..072aea7 100644 --- a/src/main/scala/scala/async/Async.scala +++ b/src/main/scala/scala/async/Async.scala @@ -75,11 +75,11 @@ abstract class AsyncBase { import builder.name import builder.futureSystemOps - // typecheck body, because the ANF transform needs type info in some places - val typedBody = c.typeCheck(body.tree) - val transform = new AnfTransform[c.type](c) - val stats1 :+ expr1 = transform.anf.transformToList(typedBody) - val btree = c.typeCheck(Block(stats1, expr1)) + val btree: Tree = { + val transform = new AnfTransform[c.type](c) + val stats1 :+ expr1 = transform.anf.transformToList(body.tree) + c.typeCheck(Block(stats1, expr1)) + } AsyncUtils.vprintln(s"In file '${c.macroApplication.pos.source.path}':") AsyncUtils.vprintln(s"${c.macroApplication}") |