managed-commons / stab-language

Automatically exported from code.google.com/p/stab-language
Apache License 2.0
5 stars 3 forks source link

Main method not defined properly #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The following main method is incorrect in java, because it misses the String[] 
parameter:

public class Main {

    public static void main(){
        System.out.println("Hello");
    }
}

this compilation will generate the error message:

sample.stab (20, 24) error 234: Cannot implicitly convert type
 '<null>' to 'boolean'
sample.stab (23, 28) error 234: Cannot implicitly convert type
 'java.lang.String' to 'boolean'
sample.stab (29, 32) error 234: Cannot implicitly convert type
 'java.lang.String' to 'boolean'
sample.stab (31, 24) error 234: Cannot implicitly convert type

Original issue reported on code.google.com by ice.ta...@gmail.com on 26 Jun 2010 at 8:06

GoogleCodeExporter commented 9 years ago
Not an error!

Original comment by ice.ta...@gmail.com on 26 Jun 2010 at 8:10

GoogleCodeExporter commented 9 years ago
However running the main method will generate the error message:

Exception in thread "main" java.lang.NoSuchMethodError: main

Original comment by ice.ta...@gmail.com on 26 Jun 2010 at 8:11

GoogleCodeExporter commented 9 years ago
The same program compiled with javac has exactly the same behaviour.

Original comment by stab.hac...@gmail.com on 26 Jun 2010 at 11:19