diff options
-rw-r--r-- | src/compiler/scala/tools/reflect/ToolBoxFactory.scala | 1 | ||||
-rw-r--r-- | test/files/run/t8637.check | 0 | ||||
-rw-r--r-- | test/files/run/t8637.scala | 9 |
3 files changed, 10 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/reflect/ToolBoxFactory.scala b/src/compiler/scala/tools/reflect/ToolBoxFactory.scala index 3b12086cc7..923297bafb 100644 --- a/src/compiler/scala/tools/reflect/ToolBoxFactory.scala +++ b/src/compiler/scala/tools/reflect/ToolBoxFactory.scala @@ -141,6 +141,7 @@ abstract class ToolBoxFactory[U <: JavaUniverse](val u: U) { factorySelf => val run = new Run run.symSource(ownerClass) = NoAbstractFile // need to set file to something different from null, so that currentRun.defines works phase = run.typerPhase // need to set a phase to something <= typerPhase, otherwise implicits in typedSelect will be disabled + globalPhase = run.typerPhase // amazing... looks like phase and globalPhase are different things, so we need to set them separately currentTyper.context.setReportErrors() // need to manually set context mode, otherwise typer.silent will throw exceptions reporter.reset() diff --git a/test/files/run/t8637.check b/test/files/run/t8637.check new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/test/files/run/t8637.check diff --git a/test/files/run/t8637.scala b/test/files/run/t8637.scala new file mode 100644 index 0000000000..99c8d4c413 --- /dev/null +++ b/test/files/run/t8637.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.currentMirror +import scala.tools.reflect.ToolBox + +object Test extends App { + val tb = currentMirror.mkToolBox() + tb.compile(q"true > true") + tb.typecheck(q"true > true") +}
\ No newline at end of file |