sergutsan / JDecafCompiler

A Java precompiler for educational purposes
1 stars 0 forks source link

Methods without brackets should be detected by Java Decaf #9

Open sergutsan opened 10 years ago

sergutsan commented 10 years ago

Methods without brackets (e.g. as in Groovy) should be detected by Java Decaf and not by Java, because they result in confusing errors, e.g. the ubersimple code:

int i = 10;
while (i < 5){
i++;
println i;
}

results in the cryptic errors

Error on line 4 in file:/tmp/error2.jdc
Problem: cannot find symbol
  symbol:   class out
  location: class java.lang.System
Error on line 4 in file:/tmp/error2.jdc
Problem: variable i is already defined in method main(java.lang.String[])

intead of something more useful like:

JavaDecaf Error: call to println() without brackets
file:/tmp/error1.jdc