Aladdin - Scala Bugtracking
[#706] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Stephane Lex fixed 2006-08-17 15:20:33.0
subject NullPointerException in MainGenericRunner
code
class Test {
  def main(args: Array[String]): Unit =
    Console.println("Test")
}
what happened
scala> ./dists/latest/bin/scala -cp /tmp Test
Exception in thread "main" java.lang.NullPointerException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at scala.tools.nsc.ObjectRunner$.run(ObjectRunner.scala:53)
        at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:96)
        at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
scala>
what expected User-friendly error message (in Java: Exception in thread "main" java.lang.NoSuchMethodError: main)
[back to overview]
Changes of this bug report
Lex  edited on  2006-08-24 16:04:08.0
ObjectRunner now tests that the main method it finds is a static method.