summaryrefslogtreecommitdiff
path: root/src/compiler/scala/reflect/runtime/ToolBoxes.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/scala/reflect/runtime/ToolBoxes.scala')
-rw-r--r--src/compiler/scala/reflect/runtime/ToolBoxes.scala12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/compiler/scala/reflect/runtime/ToolBoxes.scala b/src/compiler/scala/reflect/runtime/ToolBoxes.scala
index 70a3061fc7..b12d84b34f 100644
--- a/src/compiler/scala/reflect/runtime/ToolBoxes.scala
+++ b/src/compiler/scala/reflect/runtime/ToolBoxes.scala
@@ -164,7 +164,13 @@ trait ToolBoxes extends { self: Universe =>
}
command.settings.outputDirs setSingleOutput virtualDirectory
- new ToolBoxGlobal(command.settings, reporter)
+ val instance = new ToolBoxGlobal(command.settings, reporter)
+
+ // need to establish a run an phase because otherwise we run into an assertion in TypeHistory
+ // that states that the period must be different from NoPeriod
+ val run = new instance.Run
+ instance.phase = run.refchecksPhase
+ instance
}
lazy val importer = new compiler.Importer {
@@ -176,10 +182,6 @@ trait ToolBoxes extends { self: Universe =>
lazy val classLoader = new AbstractFileClassLoader(virtualDirectory, defaultReflectiveClassLoader)
private def importAndTypeCheck(tree: rm.Tree, expectedType: rm.Type): compiler.Tree = {
- // need to establish a run an phase because otherwise we run into an assertion in TypeHistory
- // that states that the period must be different from NoPeriod
- val run = new compiler.Run
- compiler.phase = run.refchecksPhase
val ctree: compiler.Tree = importer.importTree(tree.asInstanceOf[Tree])
val pt: compiler.Type = importer.importType(expectedType.asInstanceOf[Type])
// val typer = compiler.typer.atOwner(ctree, if (owner.isModule) cowner.moduleClass else cowner)