Skip to content

Commit

Permalink
Revert "Revert "Remove reference to OriginalTreeAttachment in Scala 2…
Browse files Browse the repository at this point in the history
….12 bridge""

This reverts commit a57185f.
  • Loading branch information
eed3si9n committed Dec 15, 2021
1 parent 05d1889 commit b8710f1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ abstract class Compat {

/** If given tree contains object tree attachment calls func on tree from attachment. */
protected def processOriginalTreeAttachment(in: Tree)(func: Tree => Unit): Unit = {
import analyzer._
in.attachments.get[OriginalTreeAttachment].foreach { a =>
func(a.original)
}
// We can't until we figure out how to conditionally do this for Scala 2.12.3+
// import analyzer._
// in.attachments.get[OriginalTreeAttachment].foreach { a =>
// func(a.original)
// }
}
}
object Compat {
Expand Down
2 changes: 2 additions & 0 deletions zinc/src/test/scala/sbt/inc/BaseCompilerSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ class BaseCompilerSpec extends BridgeProviderSpecification {

implicit class ProjectSetupOps(setup: ProjectSetup) {
def createCompiler(): CompilerSetup = setup.createCompiler(scalaVersion, incOptions)
def createCompiler(scalaVersion: String): CompilerSetup =
setup.createCompiler(scalaVersion, incOptions)

private def createCompiler(sv: String, incOptions: IncOptions): CompilerSetup = {
val si = scalaInstance(sv, setup.baseDir, Logger.Null)
Expand Down
2 changes: 1 addition & 1 deletion zinc/src/test/scala/sbt/inc/IncrementalCompilerSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class IncrementalCompilerSpec extends BaseCompilerSpec {

it should "track dependencies on constants" in withTmpDir { tmp =>
val project = VirtualSubproject(tmp.toPath / "p1")
val comp = project.setup.createCompiler()
val comp = project.setup.createCompiler("2.13.6")
try {
val s1 = "object A { final val i = 1 }"
val s1b = "object A { final val i = 2 }"
Expand Down

0 comments on commit b8710f1

Please sign in to comment.