Bug 100149 - [1.5][compiler] Raw type upper bounds should be raw types
Summary: [1.5][compiler] Raw type upper bounds should be raw types
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 RC3   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-15 06:48 EDT by Philipe Mulet CLA
Modified: 2005-06-16 14:42 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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