New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ambiguous warning when main result is not Unit #7448
Comments
Imported From: https://issues.scala-lang.org/browse/SI-7448?orig=1 |
Tanin Na Nakorn (tanin) said: You should use |
@som-snytt said: The warning should say, Scala is catholic in its notion of main, but other launchers may be unforgiving. It's possible that Scala is an Episcopalian, that is, a lover of ceremonious incantations, but also quite capable of doing without the trappings and accepting whatever is practical. |
@som-snytt said: -t1005.scala:6: warning: FromMono has a main method with parameter type Array[String], but Test.FromMono will not be a runnable program.
- Reason: main method must have exact signature (Array[String])Unit
- object FromMono{ Though if the signature is exactly that, it could warn for the reason that the object is not top-level. Or warn under -Xlint or -Xnoob. |
It sure would be nice for |
Warning about def main(args: Array[String]) = ??? is ambiguous.
This is a trivial matter, yet it burned a minute to see whether the test that provokes it is actually run. (I think all the runners use ScalaClassLoader.run.)
The text was updated successfully, but these errors were encountered: