| Summary: | [1.5][compiler] Eclipse accepts invalid generic code | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Hollis Waite <hwaite> |
| Component: | Core | Assignee: | Kent Johnson <kent_johnson> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | Olivier_Thomann, philippe_mulet |
| Version: | 3.4.2 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
javac creates the parameter type to be : List<Object&Serializable&Comparable<? extends Object&Serializable&Comparable<?>>> where we create : List<Object&Comparable<?>&Serializable> *** This bug has been marked as a duplicate of bug 142964 *** |
Build ID: M20090211-1700 Steps To Reproduce: import java.util.Arrays; import java.util.Collections; public class Test { Iterable<Object> x = Collections.unmodifiableCollection( Arrays.asList(0, "a") ); } More information: Eclipse accepts this construct but jdk1.6.0_13 yields an error: Test.java:4: incompatible types found : java.util.Collection<java.lang.Object&java.io.Serializable&java.lang.Comparable<? extends java.lang.Object&java.io.Serializable&java.lang.Comparable<?>>> required: java.lang.Iterable<java.lang.Object> Iterable<Object> x = Collections.unmodifiableCollection( I prefer the way Eclipse works. This just a variant of issue 177715?