@@ -51,7 +51,7 @@ final class BangNotation(override val global: Global) extends Plugin {
5151
5252 private trait Deactable extends AnalyzerPlugin {
5353 override def isActive (): Boolean = {
54- active && phase.id < currentRun.picklerPhase .id
54+ active && phase.id <= currentRun.typerPhase .id
5555 }
5656 }
5757
@@ -92,13 +92,15 @@ final class BangNotation(override val global: Global) extends Plugin {
9292// reporter.info(tree.pos, s"Translating to continuation-passing style: $cpsTree", true)
9393 deactAnalyzerPlugins {
9494 typer.context.withMode(ContextMode .ReTyping ) {
95- typer.typed(cpsTree, Mode .EXPRmode )
95+ typer.typed(Block ( Nil , cpsTree) , Mode .EXPRmode )
9696 }
9797 }
9898 } match {
9999 case Some (typedCpsTree) =>
100100// reporter.info(tree.pos, s"Translating to continuation-passing style: $typedCpsTree", true)
101101 typedCpsTree.modifyType(_.filterAnnotations(! _.matches(resetAnnotationSymbol)))
102+ typedCpsTree.removeAttachment[CpsAttachment ]
103+ typedCpsTree
102104 case None =>
103105 tree
104106 }
@@ -141,6 +143,11 @@ final class BangNotation(override val global: Global) extends Plugin {
141143 }
142144
143145 private def isCpsTree (tree : Tree ) = {
146+ tree match {
147+ case defDef : DefDef if defDef.name.toString == " randomInt" =>
148+ reporter.info(tree.pos, show(tree), true )
149+ case _ =>
150+ }
144151 def hasCpsAttachment (child : Any ): Boolean = {
145152 child match {
146153 case list : List [_] => list.exists(hasCpsAttachment)
0 commit comments