Community
Participate
Working Groups
After updating my eclipse this morning to 3.4.2 Build M20090211-1700 I suddenly had an eclipse compiler error on an enum type in our projects which was previously working just fine. I created a test project to verify and can reproduce the problem (test project attached): Create an enum type with the following content: public enum FailingEnum { // Following line: having the dummyField declared here causes "Syntax errors on tokens, delete tokens" compilation failure in Eclipse 3.4.2 Build M20090211-1700 // javac confirms with "<identifier> expected" // public final static int dummyField = 1; // Following line correctly causes "Cannot reference a field before it is defined" compilation failure in Eclipse 3.4.2 Build M20090211-1700 // javac confirms with "illegal forward reference" // SimpleEnumElement1(dummyField), // Following line _incorrectly_ causes "Cannot reference a field before it is defined" compilation failure in Eclipse 3.4.2 Build M20090211-1700 // javac 1.6.0_06 compiles this line without problems. SimpleEnumElement2(FailingEnum.dummyField); public final static int dummyField = 1; private FailingEnum(int dummy) { } } with javac (checked with 1.6.0_06) this class compiles like this just fine. Eclipse however complains on line 13 with "Cannot Reference a field before it is defined": SimpleEnumElement2(FailingEnum.dummyField);
Created attachment 127008 [details] Test project with example enum
*** This bug has been marked as a duplicate of bug 263877 ***
Verified for 3.5M6 using I20090310-0100.