| Summary: | Compiler: variable declaraion statment as if body | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Martin Aeschlimann <martinae> |
| Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
| Status: | RESOLVED WORKSFORME | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 2.1 | ||
| Target Milestone: | 3.0 M1 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
Variable declarations can only occur as block statements. You thus need to wrap it inside a block. We correctly detect this (as other compilers do). |
2.1 The following code does not compile ('[' or '.' expected). Is that a bug? public void a() { if (true) int xxxx= 0; } When changed to public void a() { if (true) { int xxxx= 0; } } no problems.