Bug 88263 - [1.5][compiler] Autobox and extends
Summary: [1.5][compiler] Autobox and extends
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-16 18:03 EST by Bart Geraci CLA
Modified: 2005-05-11 10:40 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bart Geraci CLA 2005-03-16 18:03:05 EST
Version: 3.1.0
Build id: I20050315-1100

Given the following code
------------------------
class Cla<A> {
	A val;
	public Cla(A x) { val = x; }
	A getVal() { return val; }
}

public class Test1 {
	
	void proc0(Cla<Long> b0) {
		final Long t1 = b0.getVal();
		final long t2 = b0.getVal();
	}

	void proc1(Cla<? extends Long> obj) {
		final Long t3 = obj.getVal();
		final long t4 = obj.getVal();
	}
}
------------------------

javac compiles without problems.

Eclipse marks the "t4" variable with the error message
 "Type mismatch: cannot convert from ? extends Long to long"
Comment 1 Philipe Mulet CLA 2005-04-05 07:57:59 EDT
Similar need for type parameters, though javac fails during emulation apparently.
Added AutoboxingTest#test102-103.
Comment 2 Philipe Mulet CLA 2005-04-05 08:55:28 EDT
Fixed by allowing these in Scope#computeBoxingType.
Comment 3 Olivier Thomann CLA 2005-05-11 10:40:50 EDT
Verified in I20050510-0010