Summary: | [1.5] Generics, assign error despite equal types | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Heri <eclipse> |
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 3.1 | ||
Target Milestone: | 3.1 M3 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Heri
2004-10-16 21:56:00 EDT
I've had several of these errors with M2 and latest integration build (I20041026). I have been able to use a cast as a workaround. Interestingly enough, the compiler reports a warning about useless cast. It never happened with "top-level" generics, bu only with "nested" generics, ie. X<A<B>>. Thinking about it, it might have to do with inner classes. Reproduced Problem comes from a mismatch in wildcards, due to capture mechanism. We are comparing Set<Map.Entry<Integer, ? denoting: V from Map) with Set<Map.Entry<Integer, ? denoting: V from Map$Entry) Ensured wildcards are properly relocated when passed around. Added regression test: GenericTypeTest#test363 Fixed Verified for 3.1 M3 with build I200411040800 Actually, reverting previous behavior which was the proper one. Javac does actually also reject this code. The 2 wildcard occurrences could denote different types. One is relative to Entry, and one is relative to Map; as said before. |