Skip to content

Commit a62d9cb

Browse files
Notify the user which main methods were discovered
1 parent f3ab85d commit a62d9cb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/scripting/ScriptingDriver.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ class ScriptingDriver(compilerArgs: Array[String], scriptFile: File, scriptArgs:
7070
case Nil =>
7171
throw ScriptingException("No main methods detected in your script")
7272
case _ :: _ :: _ =>
73-
throw ScriptingException("More than one main method detected in your script")
73+
throw ScriptingException("A script must contain only one main method. " +
74+
s"Detected the following main methods:\n${candidates.mkString("\n")}")
7475
case m :: Nil => m
7576
end match
7677
end detectMainMethod

0 commit comments

Comments
 (0)