Summary: | [1.5][compiler] Invalid compilation errors regarding Enum intializers | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | James Leone <jleone> | ||||
Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> | ||||
Status: | RESOLVED DUPLICATE | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | ||||||
Version: | 3.1.2 | ||||||
Target Milestone: | --- | ||||||
Hardware: | PC | ||||||
OS: | Windows 2000 | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
James Leone
2006-06-28 12:56:55 EDT
Created attachment 45479 [details]
Sample enum that should compile
javac 6.0b88 agrees with us: X.java:5: illegal reference to static field from initializer System.out.printf("After the %s constructor\n",INITIAL); ^ 1 error but javac 1.5.0_07 compiles it fine. Looks like a bug has been fixed. If you qualify the access, then it compiles fine with both Eclipse and javac 6.0b88. public enum State { INITIAL , OPENED { { System.out.printf("After the %s constructor\n",State.INITIAL); } } } Closing as dup of bug 101713. *** This bug has been marked as a duplicate of 101713 *** Added regression test org.eclipse.jdt.core.tests.compiler.regression.EnumTest.test134 |