Skip to content

Commit

Permalink
Merge pull request #257 from Atry/keep-blocks
Browse files Browse the repository at this point in the history
Don't eliminate blocks after CPS transformation
  • Loading branch information
Atry authored Jun 3, 2019
2 parents 2201775 + e90adff commit 90969cf
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,12 @@ final class BangNotation(override val global: Global) extends Plugin {
def loop(stats: List[Tree]): Tree = {
stats match {
case Nil =>
cpsAttachment(expr)(continue)
cpsAttachment(expr) {
case block: Block =>
continue(block)
case notBlock =>
continue(treeCopy.Block(tree, Nil, notBlock))
}
case (valDef @ ValDef(mods, name, tpt, rhs)) :: tail =>
// TODO: lazy val
cpsAttachment(rhs) { rhsValue =>
Expand Down

0 comments on commit 90969cf

Please sign in to comment.