Skip to content

Commit

Permalink
Merge pull request #994 from eed3si9n/wip/revert_OriginalTreeAttachments
Browse files Browse the repository at this point in the history
Remove reference to OriginalTreeAttachment in Scala 2.12 bridge
  • Loading branch information
eed3si9n authored Jul 12, 2021
2 parents 2d457e7 + 3b0268a commit 5b1f92d
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 5b1f92d

Please sign in to comment.