Summary: | [1.5][compiler] Error creating array of generics of inner class. | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Ramon Garcia <ramon.garcia.f+eclipse> |
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 3.1.2 | ||
Target Milestone: | 3.2 M6 | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: |
Description
Ramon Garcia
2006-03-06 09:22:13 EST
Using javac1.6b74: testGeneric2.java:5: generic array creation t2<?,?>[] at = new t2<?,?>[5]; ^ 1 error I am almost sure that the code is correct. Because it is necessary. Otherwise it would be imposible to create an array of inner generic classes. With generic classes one cannot create arrays of concrete generic classes, because there are some kind of errors that would not be caught by the compiler. So one has the alternative of creating arrays of unbound generic classes. With this error, this alternative becomes void. The enclosing type must be reifiable too, in your case it is not. t2<?,?> has testGeneric2<A> as its enclosing type, which isn't reifiable. In a static method, this should be allowed though, as no enclosing type pertains there. We actually missed the static method scenario. Added GenericTypeTest#test0954. Fixed forgot to assign fixed Thanks, in my case it was a static method, so this fix will be useful for me. Verified for 3.2 M6 using build I20060328-0010 |