Community
Participate
Working Groups
The following code doesn't work with eclipse but works with javac. static <T> List<T> merge(List<? extends T> a,List<? extends T> b) { return null; } public static void main(String[] args) { List<String> list1=null; List<StringBuilder> list2=null; List<? extends CharSequence> result = merge(list1,list2); } Rémi Forax
Indeed, we should accept it. Current error is: List<? extends CharSequence> result = merge(list1, list2); ^^^^^^^^^^^^^^^^^^^ Type mismatch: cannot convert from List<Object&Serializable&CharSequence> to List<? extends CharSequence> which is clearly wrong. Seems to be an issue with intersection type.
TypeBinding#isTypeArgumentContainedBy(...) did not properly handle intersection type. Fixed. Added GenericTypeTest#test842. Released in 3.1 maintenance and 3.2 branch.
*** Bug 121231 has been marked as a duplicate of this bug. ***
Verified for 3.1.2 in M20060109-0800.
Verified for 3.2M4 in I20051215-1506