Bug 262209

Summary: [1.5][compiler]Incorrect ambiguous method calls
Product: [Eclipse Project] JDT Reporter: Kent Johnson <kent_johnson>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: david_audel, philippe_mulet
Version: 3.5   
Target Milestone: 3.5 M5   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 262208    
Attachments:
Description Flags
Proposed patch and testcase
none
Proposed patch and testcase for 3.4.2 none

Description Kent Johnson CLA 2009-01-23 12:49:56 EST
Currently we get all 5 of these method calls incorrect. We report 1 error against the wrong method & miss the other 4.


interface I<T> {}

class X {
	void a(G x) {}
	void a(F<?> x) {}

	<T extends G> void b(T x) {}
	<T extends C, S extends F<T>> void b(S x) {}

	<T extends G> void c(T x) {}
	void c(F<?> x) {}

	<T extends G> void d(T x) {}
	<S extends F & I<S>> void d(S x) {}

	void x(G x) {}
	<S extends F> void x(S x) {}

	void test() {
		X x = new X();
		H<C> h = null;
		H hraw = null;

		x.a(h); // ambiguous error
		x.b(h); // ambiguous error
		x.c(h); // ambiguous error
		x.d(hraw); // ambiguous error

		x.x(h);	// NOT ambiguous
	}
}

class C {}
class F<T1> {} 
class G<T2> extends F<T2> implements I<T2> {}
class H<T3> extends G<T3> {}
Comment 1 Kent Johnson CLA 2009-01-23 13:19:48 EST
Created attachment 123571 [details]
Proposed patch and testcase
Comment 2 Kent Johnson CLA 2009-01-23 14:53:38 EST
Fix and test released for 3.5M5
Comment 3 Kent Johnson CLA 2009-01-23 14:57:03 EST
Philippe - should we fix this for 3.4.2 ?
Comment 4 Kent Johnson CLA 2009-01-23 14:57:58 EST
Created attachment 123586 [details]
Proposed patch and testcase for 3.4.2
Comment 5 David Audel CLA 2009-01-27 07:03:44 EST
Verified for 3.5M5 using I20090126-1300