Skip to content

Commit 878db33

Browse files
committed
ScriptEngine: Avoid classpath pollution
If we don't set "-classpath" explicily the default will be "-classpath .", this resulted in test failures due to "." containing the output of previous tests.
1 parent 3d13696 commit 878db33

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

compiler/src/dotty/tools/repl/ScriptEngine.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ import dotc.core.StdNames.str
1717
* println(e.eval("42"))
1818
*/
1919
class ScriptEngine extends AbstractScriptEngine {
20-
private[this] val driver = new ReplDriver(Array("-usejavacp", "-color:never"), Console.out, None)
20+
private[this] val driver = new ReplDriver(
21+
Array(
22+
"-classpath", "", // Avoid the default "."
23+
"-usejavacp",
24+
"-color:never"
25+
), Console.out, None)
2126
private[this] val rendering = new Rendering
2227
private[this] var state: State = driver.initialState
2328

0 commit comments

Comments
 (0)