Bug 81594

Summary: [compiler][1.5] problem with type bounds in method call
Product: [Eclipse Project] JDT Reporter: Guillaume Pothier <gpothier>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M5   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Guillaume Pothier CLA 2004-12-18 11:57:04 EST
3.1M4

The following class compiles fine with Sun's javac, but eclipse reports the
following error:
The method method(List<? extends T>, T, Test.Typed<? super T>) in the type Test
is not applicable for the arguments (List<Test.B>, Test.B, Test.MyTyped)

public class Test
{
	List<B> itsList;
	B itsB;
	MyTyped itsTyped;
	
	
	public void test()
	{
		method (itsList, itsB, itsTyped);
	}
	
	public <T> void method (List<? extends T> arg1, T arg2, Typed<? super T> arg3)
	{
	}
	
	interface A{}
	class B implements A{}
	class Typed<T>{}
	class MyTyped extends Typed<A>{}

}

If A is a class instead of an interface, there is no problem.

It is possible to simplify the test case:

public class Test
{
	Typed<B> itsList;
	Typed<A> itsTyped;
	
	
	public void test()
	{
		method (itsList, itsTyped);
	}
	
	public <T> void method (Typed<? extends T> arg1, Typed<? super T> arg3)
	{
	}
	
	interface A{}
	class B implements A{}
	class Typed<T>{}

}
Comment 1 Philipe Mulet CLA 2005-01-27 16:12:25 EST
Cannot reproduce any longer in latest.
Added GenericTypeTest#test473-474
Closing