From 36e3c66b85b23d2d8ec05248a253689bd054080e Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Mon, 28 Feb 2022 08:46:29 -0800 Subject: [PATCH] Partial revert to minimize diff --- compiler/src/dotty/tools/MainGenericRunner.scala | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/compiler/src/dotty/tools/MainGenericRunner.scala b/compiler/src/dotty/tools/MainGenericRunner.scala index e3d91fab972b..18cc7b9c4866 100644 --- a/compiler/src/dotty/tools/MainGenericRunner.scala +++ b/compiler/src/dotty/tools/MainGenericRunner.scala @@ -166,9 +166,8 @@ object MainGenericRunner { .withTargetScript(arg) .withScriptArgs(tail*) else - val modalSettings = if arg.startsWith("-") then settings else settings.withPossibleEntryPaths(arg).withModeShouldBePossibleRun - val newSettings = modalSettings.withResidualArgs(arg) - process(tail, newSettings) + val newSettings = if arg.startsWith("-") then settings else settings.withPossibleEntryPaths(arg).withModeShouldBePossibleRun + process(tail, newSettings.withResidualArgs(arg)) end process def main(args: Array[String]): Unit = @@ -200,8 +199,7 @@ object MainGenericRunner { Option.when(Jar.isJarOrZip(dotty.tools.io.Path(entryPath)))(Jar(entryPath).mainClass).flatten }.isDefined } - val newSettings = - targetToRun match + val newSettings = targetToRun match case Some(fqName) => settings.withTargetToRun(fqName).copy(residualArgs = settings.residualArgs.filterNot(fqName.==)).withExecuteMode(ExecuteMode.Run) case None =>