Community
Participate
Working Groups
The following two test should be both return true or both return false: java.util.Collection<E extends java.lang.Object>= java.util.Collection<E extends java.lang.Object>: true java.util.Collection<E extends java.lang.Object>= java.util.Vector<E extends java.lang.Object>: false
From a type model point of view I would prefer false.
I don't understand. You can assign a variable of type java.util.Collection<E> to another variable of type java.util.Collection<E>.
Sorry for not being precise enough: all type bindings refer to generic type binding (e.g. the one from the declaration) not to parameterized types. In declarations (fields, locals, parameters, return types) generic types can't be used. Only parameterized types can be used here. All I try to say is that isAssignmentCompatible on generic types seems to be questionable. But if we support this we should do it for java.util.Collection<E>= java.util.Vector<E> as well. I think the problem comes from the fact that the compiler bindings first check if the bindings are indentical and then return true.
Dirk - is this still an issue in latest ? Compatibility rules changed quite a few times since then. Please reopen if still an issue.
closing as no information in a long time, and many fixes occurred in this area since then.
closing