Bug 203318 - [1.5][compiler] Improper capture of wildcard with lesser bound than parameter
Summary: [1.5][compiler] Improper capture of wildcard with lesser bound than parameter
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3.2   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 202404
Blocks:
  Show dependency tree
 
Reported: 2007-09-13 13:06 EDT by Philipe Mulet CLA
Modified: 2008-09-16 09:49 EDT (History)
2 users (show)

See Also:
philippe_mulet: pmc_approved+


Attachments
Proposed patch (2.22 KB, patch)
2007-09-13 13:07 EDT, Philipe Mulet CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philipe Mulet CLA 2007-09-13 13:06:36 EDT
Build 3.4m1

The following code should compile clean:

class X<T extends Number> {
	T get() {	return null; };
    void foo(X<? extends Object> x) {
		x.get().intValue();    	
    }
}

but currently, #intValue() is not found since the capture superclass is considered to be Object instead of Number.
Comment 1 Philipe Mulet CLA 2007-09-13 13:07:57 EDT
Created attachment 78347 [details]
Proposed patch
Comment 2 Philipe Mulet CLA 2007-09-13 13:10:57 EDT
This fix first requires addressing bug 202404 first.
Comment 3 Philipe Mulet CLA 2007-09-13 18:27:46 EDT
Added GenericTypeTest#test1165
Released for 3.4M2
Fixed
Comment 4 David Audel CLA 2007-09-18 06:30:35 EDT
Verified for 3.4M2 using build I20070918-0010
Comment 5 Philipe Mulet CLA 2007-10-10 04:26:20 EDT
considering for 3.3.2
Comment 6 Philipe Mulet CLA 2007-10-10 04:26:53 EDT
Released for 3.3.2
Fixed
Comment 7 Maxime Daniel CLA 2007-10-29 12:44:45 EDT
Only adding Verified for 3.4M2 to the status whiteboard, since I believe this
got lost.
Comment 8 Jerome Lanneluc CLA 2007-11-22 10:17:45 EST
The compiler semantics near capture conversion need to be tuned to match the spec. Without these changes, we see quite many corner cases failing to compile properly or being rejected incorrectly, and numerous customers starting to notice it.
Comment 9 Philipe Mulet CLA 2007-11-23 09:18:59 EST
+1 for 3.3.2
Comment 10 David Audel CLA 2008-01-24 04:35:56 EST
Verified for 3.3.2 using build M20080123-0800