Bug 112500

Summary: [1.5][compiler] bug between inference and wilcard
Product: [Eclipse Project] JDT Reporter: Rémi Forax <forax>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jim
Version: 3.2   
Target Milestone: 3.1.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Rémi Forax CLA 2005-10-13 11:10:20 EDT
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
Comment 1 Philipe Mulet CLA 2005-10-13 12:16:21 EDT
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.
Comment 2 Philipe Mulet CLA 2005-10-13 12:36:21 EDT
TypeBinding#isTypeArgumentContainedBy(...) did not properly handle intersection
type. 

Fixed. Added GenericTypeTest#test842.
Released in 3.1 maintenance and 3.2 branch.
Comment 3 Olivier Thomann CLA 2005-12-19 13:17:12 EST
*** Bug 121231 has been marked as a duplicate of this bug. ***
Comment 4 Olivier Thomann CLA 2006-01-09 11:04:23 EST
Verified for 3.1.2 in M20060109-0800.
Comment 5 Olivier Thomann CLA 2006-01-10 10:33:59 EST
Verified for 3.2M4 in I20051215-1506