Bug 81594 - [compiler][1.5] problem with type bounds in method call
Summary: [compiler][1.5] problem with type bounds in method call
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.1 M5   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-18 11:57 EST by Guillaume Pothier CLA
Modified: 2005-01-27 16:12 EST (History)
0 users

See Also:


Attachments

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