Community
Participate
Working Groups
Try this code: class Base { public Base(String foo) { } } class SubClass extends Base { public SubClass() { System.out.println("a statement"); super("bar"); } } The error reported is: Syntax error on token "(", "." expected SubClass.java The javac error is (more helpful): SubClass.java:5: call to super must be first statement in constructor super("bar");
David - can the syntax recovery handle this one ? Alternatively, we could make our grammar less strict, and check this situation after the fact.
Fixed.
Verified.