| Summary: | [dom] Bindings for unbound wildcard type should be unique | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Markus Keller <markus.kell.r> |
| Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | dirk_baeumer, martinae |
| Version: | 3.2 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | stalebug | ||
Wildcard bindings retain information from their associated type parameter, for enabling capturing; and thus are not identical. It is questionable they should compare equal. Hmm, our TTypes (and probably other clients) currently assume wildcard types are
unique if their bounds are the same. If that's not true any more with captures,
then we should probably add a query to differentiate the two.
OTOH, are you sure the additional information is really about the associated
type parameter? When I inspect the program below, I see that the type bindings
for the two '?' have the same key 'Lxy/Try~Two;*'. If the bindings should really
be different, then their keys should be changed to include more information than
they currently do (looks like the declaring type only).
class Try {
void m() {
Two<?, ?> two= new Two<String, Integer>();
}
}
class Two<A, B extends Number> { }
Jerome - the point on binding keys is valid. Different bindings shouldn't have the same key. BindingComparator#isEqual(TypeBinding, TypeBinding, HashSet) should take into account WildCardBinding#typeVariable. The binding key should also include the type variable. Deferring post 3.4 This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |
I20050906-1200 public class Try { Class<?> c; java.util.List<?> l; } The bindings for the ? in Class<?> and List<?> are not identical and have different keys, but isEqualTo(..) returns true. The resolved bindings should be identical. The key should match the one from BindingKey#createWilcardTypeBindingKey(..) and BindingKey#internalToSignature() should convert it to a valid signature.