Bug 100149

Summary: [1.5][compiler] Raw type upper bounds should be raw types
Product: [Eclipse Project] JDT Reporter: Philipe Mulet <philippe_mulet>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: dirk_baeumer
Version: 3.1   
Target Milestone: 3.1 RC3   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Philipe Mulet CLA 2005-06-15 06:48:58 EDT
3.1rc2

The implicit arguments used for a raw type should be converted to raw form.
Currently, the upper bounds of formal parameters are used as is.

This is demonstrated by unproper error message for following program:

import java.util.List;

public class X<T extends X<?>> {
	T get() { return null; }
	void foo(X x) {
		String s = x.get();
	}
}
reports:
Type mismatch: cannot convert from X<capture-of ?> to String

where it should (as javac does) report:
Type mismatch: cannot convert from X to String
Comment 1 Philipe Mulet CLA 2005-06-15 06:51:17 EDT
Other testcase, the following program should be accepted with an unchecked
warning. We currently reject it.

import java.util.List;

public class X<T extends List<String>> {
	T get() { return null; }
	void foo(X x) {
		List<Object> l = x.get();
	}
}
Comment 2 Philipe Mulet CLA 2005-06-15 06:51:58 EDT
+1 for RC3

Dirk - pls cast your vote. Fix is trivial.
Comment 3 Philipe Mulet CLA 2005-06-15 07:20:43 EDT
Added GenericTypeTest#test749-750
Comment 4 Dirk Baeumer CLA 2005-06-15 08:39:57 EDT
+1 fir RC3.
Comment 5 Philipe Mulet CLA 2005-06-15 08:59:46 EDT
fixed
Comment 6 Olivier Thomann CLA 2005-06-16 14:42:01 EDT
Verified using N20050616-0010 + JDT/Core HEAD