Summary: | Encountered "case statement must be constant" error | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Missing name <yasuday> |
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
Status: | RESOLVED WONTFIX | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | fuse |
Version: | 2.0.2 | ||
Target Milestone: | 2.1 M4 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Missing name
2002-11-19 06:27:07 EST
Moving to JDT Core. We did fix a couple cases where our compiler was too permissive. In particular, expressions denoting constants through a non-static references were incorrectly allowed. e.g. public class X { public final static int CST = 1; public static void main(String[] arguments) { X x = new X(); switch (1) { case x.CST : break; } } } "case x.CST" should be replaced with "case X.CST" or simply "case CST" where it applies. Ok to close? Or is your scenario different from this one ? Closing, please reopen if you have a test case which we reject incorrectly. |