Summary: | [1.5][compiler] Eclipse allows List<void[]>, javac doesn't | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Christopher Sahnwaldt <jcsahnwaldt> | ||||||
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||
Severity: | minor | ||||||||
Priority: | P3 | CC: | jcsahnwaldt, philippe_mulet | ||||||
Version: | 3.2 | ||||||||
Target Milestone: | 3.3 M4 | ||||||||
Hardware: | PC | ||||||||
OS: | Windows XP | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Christopher Sahnwaldt
2006-10-05 17:25:07 EDT
Good find. We should revisit our error messages for void[] to only have one blaming the type reference directly, i.e. 'void[] is an invalid type' import java.util.*; public class X { List<void[]> x = null; void[] y; void[] foo(void[] arg) { void[] local; } } import java.util.*; public class X { List<void[]> x = null; void[] y; void[] foo(void[] arg) { void[] local; Class c = void[].class; } } import java.util.*; public class X { List<void[]> x = null; void[] y; void[] foo(void[] arg) { try { void[] local; Class c = void[].class; } catch(void[] e) { } } } We also miss check on cast to (void[]) import java.util.*; public class X { List<void[]> x = null; void[] y; void[] foo(void[] arg) { try { void[] local = new void[0]; void[] local1 = new void[]{ null, null }; void[] local2 = { null, null }; System.out.println((void[]) null); Class c = void[].class; } catch(void[] e) { } } } (In reply to comment #2) > We should revisit our error messages for void[] to only have one blaming the > type reference directly, i.e. 'void[] is an invalid type' Philippe, Do you prefer 'void[] is an invalid type' or 'An array of void is an invalid type'? I would vote for the first one. Created attachment 53581 [details]
Proposed fix
Created attachment 53582 [details]
Regression tests
Released for 3.3M4. Verified for 3.3 M4 using build I20061212-0010. |