Skip to content

Commit c92d0d6

Browse files
committed
Runner sets residual args instead of append
1 parent c923db2 commit c92d0d6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

compiler/src/dotty/tools/MainGenericRunner.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,13 @@ object MainGenericRunner {
199199
Option.when(Jar.isJarOrZip(dotty.tools.io.Path(entryPath)))(Jar(entryPath).mainClass).flatten
200200
}.isDefined
201201
}
202-
targetToRun match
202+
val newSettings =
203+
targetToRun match
203204
case Some(fqName) =>
204-
run(settings.withTargetToRun(fqName).withResidualArgs(settings.residualArgs.filter { _ != fqName }*).withExecuteMode(ExecuteMode.Run))
205+
settings.withTargetToRun(fqName).copy(residualArgs = settings.residualArgs.filterNot(fqName.==)).withExecuteMode(ExecuteMode.Run)
205206
case None =>
206-
run(settings.withExecuteMode(ExecuteMode.Repl))
207+
settings.withExecuteMode(ExecuteMode.Repl)
208+
run(newSettings)
207209
case ExecuteMode.Run =>
208210
val scalaClasspath = ClasspathFromClassloader(Thread.currentThread().getContextClassLoader).split(classpathSeparator)
209211
val newClasspath = (settings.classPath.flatMap(_.split(classpathSeparator).filter(_.nonEmpty)) ++ removeCompiler(scalaClasspath) :+ ".").map(File(_).toURI.toURL)

0 commit comments

Comments
 (0)