diff options
Diffstat (limited to 'test/junit/scala/tools/nsc/backend/jvm/BTypesTest.scala')
-rw-r--r-- | test/junit/scala/tools/nsc/backend/jvm/BTypesTest.scala | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/test/junit/scala/tools/nsc/backend/jvm/BTypesTest.scala b/test/junit/scala/tools/nsc/backend/jvm/BTypesTest.scala index 6ada0e20fb..e7bbbb9a4f 100644 --- a/test/junit/scala/tools/nsc/backend/jvm/BTypesTest.scala +++ b/test/junit/scala/tools/nsc/backend/jvm/BTypesTest.scala @@ -10,22 +10,15 @@ import org.junit.Assert._ import scala.tools.nsc.backend.jvm.CodeGenTools._ import scala.tools.testing.ClearAfterClass -object BTypesTest extends ClearAfterClass.Clearable { - var compiler = { - val comp = newCompiler(extraArgs = "-Ybackend:GenBCode -Yopt:l:none") +@RunWith(classOf[JUnit4]) +class BTypesTest extends ClearAfterClass { + val compiler = cached("compiler", () => { + val comp = newCompiler(extraArgs = "-Yopt:l:none") new comp.Run() // initializes some of the compiler comp.exitingDelambdafy(comp.scalaPrimitives.init()) // needed: it's only done when running the backend, and we don't actually run the compiler comp.exitingDelambdafy(comp.genBCode.bTypes.initializeCoreBTypes()) comp - } - def clear(): Unit = { compiler = null } -} - -@RunWith(classOf[JUnit4]) -class BTypesTest extends ClearAfterClass { - ClearAfterClass.stateToClear = BTypesTest - - val compiler = BTypesTest.compiler + }) import compiler.genBCode.bTypes._ def classBTFS(sym: compiler.Symbol) = compiler.exitingDelambdafy(classBTypeFromSymbol(sym)) |