diff --git a/compiler/src/dotty/tools/repl/ScriptEngine.scala b/compiler/src/dotty/tools/repl/ScriptEngine.scala index 7a03fa3eab8e..786279ff5a07 100644 --- a/compiler/src/dotty/tools/repl/ScriptEngine.scala +++ b/compiler/src/dotty/tools/repl/ScriptEngine.scala @@ -24,7 +24,7 @@ class ScriptEngine extends AbstractScriptEngine { "-color:never", "-Xrepl-disable-display" ), Console.out, None) - private val rendering = new Rendering + private val rendering = new Rendering(Some(getClass.getClassLoader)) private var state: State = driver.initialState def getFactory: ScriptEngineFactory = new ScriptEngine.Factory diff --git a/tests/run-with-compiler/scripting.check b/tests/run-with-compiler/scripting.check index d81cc0710eb6..daaac9e30302 100644 --- a/tests/run-with-compiler/scripting.check +++ b/tests/run-with-compiler/scripting.check @@ -1 +1,2 @@ 42 +42 diff --git a/tests/run-with-compiler/scripting.scala b/tests/run-with-compiler/scripting.scala index 4b5807b29385..27d13cba601c 100644 --- a/tests/run-with-compiler/scripting.scala +++ b/tests/run-with-compiler/scripting.scala @@ -3,5 +3,6 @@ object Test { val m = new javax.script.ScriptEngineManager(getClass().getClassLoader()) val e = m.getEngineByName("scala") println(e.eval("42")) + println(e.eval("Some(42)").asInstanceOf[Option[Int]].get) } }