Skip to content

Commit

Permalink
Merge pull request #291 from ThoughtWorksInc/Atry-patch-1
Browse files Browse the repository at this point in the history
Upgrade to Scala 2.12.9
  • Loading branch information
Atry authored Sep 6, 2019
2 parents 4802e63 + 9b889ee commit f2f3cb0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ language: scala

scala:
- 2.11.12
- 2.12.8
- 2.12.9
- 2.13.0

jdk:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ final class BangNotation(override val global: Global) extends Plugin {

private trait Deactable extends AnalyzerPlugin {
override def isActive(): Boolean = {
active && phase.id < currentRun.picklerPhase.id
active && phase.id <= currentRun.typerPhase.id
}
}

Expand Down Expand Up @@ -92,13 +92,15 @@ final class BangNotation(override val global: Global) extends Plugin {
// reporter.info(tree.pos, s"Translating to continuation-passing style: $cpsTree", true)
deactAnalyzerPlugins {
typer.context.withMode(ContextMode.ReTyping) {
typer.typed(cpsTree, Mode.EXPRmode)
typer.typed(Block(Nil, cpsTree), Mode.EXPRmode)
}
}
} match {
case Some(typedCpsTree) =>
// reporter.info(tree.pos, s"Translating to continuation-passing style: $typedCpsTree", true)
typedCpsTree.modifyType(_.filterAnnotations(!_.matches(resetAnnotationSymbol)))
typedCpsTree.removeAttachment[CpsAttachment]
typedCpsTree
case None =>
tree
}
Expand Down Expand Up @@ -141,6 +143,11 @@ final class BangNotation(override val global: Global) extends Plugin {
}

private def isCpsTree(tree: Tree) = {
tree match {
case defDef: DefDef if defDef.name.toString == "randomInt" =>
reporter.info(tree.pos, show(tree), true)
case _ =>
}
def hasCpsAttachment(child: Any): Boolean = {
child match {
case list: List[_] => list.exists(hasCpsAttachment)
Expand Down

0 comments on commit f2f3cb0

Please sign in to comment.