| Summary: | [compiler] Misleading error message for annotations inside a method body | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Olivier Thomann <Olivier_Thomann> | ||||
| Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | satyam.kandula | ||||
| Version: | 3.7 | ||||||
| Target Milestone: | 3.7 M7 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 191148 [details]
Proposed fix + updated regression test
This is now consistent with the message for member interfaces.
Released for 3.7M7 Verified for 3.7M7 using build I20110421-1800 |
public class X { public static String foo() { @interface C {} return ""; } } Compiling this with HEAD leads to: The member annotation C can only be defined inside a static context. It has nothing to do with the static context. Only the error message is wrong. This is detected as an invalid local type.