Skip to content

Commit f2f3cb0

Browse files
authored
Merge pull request #291 from ThoughtWorksInc/Atry-patch-1
Upgrade to Scala 2.12.9
2 parents 4802e63 + 9b889ee commit f2f3cb0

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ language: scala
99

1010
scala:
1111
- 2.11.12
12-
- 2.12.8
12+
- 2.12.9
1313
- 2.13.0
1414

1515
jdk:

compilerplugins-BangNotation/src/main/scala/com/thoughtworks/dsl/compilerplugins/BangNotation.scala

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)