Summary: | [1.5][compiler] No compilation error on invalid construct | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Zorzella Mising name <zorzella> |
Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
Status: | RESOLVED DUPLICATE | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 3.1 | ||
Target Milestone: | 3.1.1 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Zorzella Mising name
2005-04-20 18:39:55 EDT
Unclear why this should be any different from: public class X { static String other; static { other = "other"; } } which is accepted just fine. I also looked at it, baffled, for quite some time. It might be something specific to the way enums are spec'ed (maybe the fine print in the language specification). Rather than dive into it myself, I trusted that if a) javac balks at it, and b) the java virtual machine throws a nasty error, then it's quite likely invalid... Zorzella What nasty error did you get running our generated classfile ? I did not get any. Tried with latest. No error reported. javac complains, but I could not understand why. Actually, javac is right here. One cannot refer to an enum constant within code which is going to perform while it is getting initialized (enum constants are triggering constructors/initializers). Added GenericTypeTest#test791 *** This bug has been marked as a duplicate of 101713 *** Actually, regression test is: EnumTest#test121 |