Fix REPL runner (#3624)

`main` method is now special because it is trully static i.e. no
implicit `self` is being generated for it.
But since REPL's `main` isn't called `main` its invocation was missing
an argument.

Follow up on https://github.com/enso-org/enso/pull/3569

# Important Notes
Will work on adding a CI test for REPL to avoid problems with REPL in a
follow up PR.
This commit is contained in:
Hubert Plociniczak 2022-08-08 10:27:53 +02:00 committed by GitHub
parent 42dbd8bb59
commit 1eec315ce1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -756,7 +756,10 @@ object Main {
val mainCons = mainModule.getAssociatedConstructor
val mainFun = mainModule.getMethod(mainCons, mainMethodName)
mainFun match {
case Some(main) => main.execute()
case Some(main) if mainMethodName != "main" =>
main.execute(mainCons.newInstance())
case Some(main) =>
main.execute()
case None =>
err.println(
s"The module ${mainModule.getName} does not contain a `main` " +