Bug 262209 - [1.5][compiler]Incorrect ambiguous method calls
Summary: [1.5][compiler]Incorrect ambiguous method calls
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.5 M5   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 262208
  Show dependency tree
 
Reported: 2009-01-23 12:49 EST by Kent Johnson CLA
Modified: 2009-01-27 07:03 EST (History)
2 users (show)

See Also:


Attachments
Proposed patch and testcase (21.84 KB, patch)
2009-01-23 13:19 EST, Kent Johnson CLA
no flags Details | Diff
Proposed patch and testcase for 3.4.2 (21.04 KB, patch)
2009-01-23 14:57 EST, Kent Johnson CLA
no flags Details | Diff

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