diff --git a/compile/interface/src/test/scala/xsbt/ExtractAPISpecification.scala b/compile/interface/src/test/scala/xsbt/ExtractAPISpecification.scala index 839955689..3d58699e9 100644 --- a/compile/interface/src/test/scala/xsbt/ExtractAPISpecification.scala +++ b/compile/interface/src/test/scala/xsbt/ExtractAPISpecification.scala @@ -15,7 +15,7 @@ class ExtractAPISpecification extends Specification { def stableExistentialNames: Boolean = { def compileAndGetFooMethodApi(src: String): Def = { - val compilerForTesting = new ScalaCompilerForUnitTesting + val compilerForTesting = new ScalaCompilerForUnitTesting(nameHashing = false) val sourceApi = compilerForTesting.extractApiFromSrc(src) val FooApi = sourceApi.definitions().find(_.name() == "Foo").get.asInstanceOf[ClassLike] val fooMethodApi = FooApi.structure().declared().find(_.name == "foo").get @@ -66,7 +66,7 @@ class ExtractAPISpecification extends Specification { | class Foo extends Namers |} |""".stripMargin - val compilerForTesting = new ScalaCompilerForUnitTesting + val compilerForTesting = new ScalaCompilerForUnitTesting(nameHashing = false) val apis = compilerForTesting.extractApisFromSrcs(reuseCompilerInstance = false)(List(src1, src2), List(src2)) val _ :: src2Api1 :: src2Api2 :: Nil = apis.toList val namerApi1 = selectNamer(src2Api1) @@ -92,7 +92,7 @@ class ExtractAPISpecification extends Specification { val srcC6 = "class C6 extends AnyRef with X { self: X with Y => }" val srcC7 = "class C7 { _ => }" val srcC8 = "class C8 { self => }" - val compilerForTesting = new ScalaCompilerForUnitTesting + val compilerForTesting = new ScalaCompilerForUnitTesting(nameHashing = false) val apis = compilerForTesting.extractApisFromSrcs(reuseCompilerInstance = true)( List(srcX, srcY, srcC1, srcC2, srcC3, srcC4, srcC5, srcC6, srcC7, srcC8) ).map(x => collectFirstClass(x.definitions)) diff --git a/compile/interface/src/test/scala/xsbt/ScalaCompilerForUnitTesting.scala b/compile/interface/src/test/scala/xsbt/ScalaCompilerForUnitTesting.scala index 95a27a30d..31faf2a24 100644 --- a/compile/interface/src/test/scala/xsbt/ScalaCompilerForUnitTesting.scala +++ b/compile/interface/src/test/scala/xsbt/ScalaCompilerForUnitTesting.scala @@ -20,7 +20,7 @@ import ScalaCompilerForUnitTesting.ExtractedSourceDependencies * Provides common functionality needed for unit tests that require compiling * source code using Scala compiler. */ -class ScalaCompilerForUnitTesting(nameHashing: Boolean = false) { +class ScalaCompilerForUnitTesting(nameHashing: Boolean, includeSynthToNameHashing: Boolean = false) { /** * Compiles given source code using Scala compiler and returns API representation @@ -127,7 +127,7 @@ class ScalaCompilerForUnitTesting(nameHashing: Boolean = false) { private def compileSrcs(groupedSrcs: List[List[String]], reuseCompilerInstance: Boolean): (Seq[File], TestCallback) = { withTemporaryDirectory { temp => - val analysisCallback = new TestCallback(nameHashing) + val analysisCallback = new TestCallback(nameHashing, includeSynthToNameHashing) val classesDir = new File(temp, "classes") classesDir.mkdir() diff --git a/interface/src/test/scala/xsbti/TestCallback.scala b/interface/src/test/scala/xsbti/TestCallback.scala index f0658597b..04c9b5756 100644 --- a/interface/src/test/scala/xsbti/TestCallback.scala +++ b/interface/src/test/scala/xsbti/TestCallback.scala @@ -5,7 +5,7 @@ import scala.collection.mutable.ArrayBuffer import xsbti.api.SourceAPI import xsbti.DependencyContext._ -class TestCallback(override val nameHashing: Boolean = false) extends AnalysisCallback +class TestCallback(override val nameHashing: Boolean, override val includeSynthToNameHashing: Boolean) extends AnalysisCallback { val sourceDependencies = new ArrayBuffer[(File, File, DependencyContext)] val binaryDependencies = new ArrayBuffer[(File, String, File, DependencyContext)]