Bug 202624 - [1.5][compiler] generics, wrong error 'method not applicable for arguments'
Summary: [1.5][compiler] generics, wrong error 'method not applicable for arguments'
Status: VERIFIED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 blocker (vote)
Target Milestone: 3.4 M2   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-07 09:20 EDT by David Akehurst CLA
Modified: 2007-09-17 09:02 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Akehurst CLA 2007-09-07 09:20:05 EDT
Build ID: I20070625-1500

Steps To Reproduce:
This code compiles in versions 3.1 and 3.2 of eclipse but not in version 3.3 or 3.4, 

public class Test {
	public <A, B> void func(Class<? extends XX<A, B>> cls) {}
	public void func() {
		func(XX.class);
	}
	class XX<A, B> {}
}

More information:
Comment 1 Philipe Mulet CLA 2007-09-07 09:55:25 EDT
This was a bug which got resolved in 3.3. Basically, the compiler should have been rejecting such code. This results from the fact Class<XX> is not assignable to Class<? extends XX<A,B>>.

Basically raw type arguments are not compatible with parameterized forms of type arguments.

Invalid, btw javac5 (1.5.0_12-ea) and javac6 (1.6.0_03-ea) both agree with us.

Added GenericTypeTest#test1157
Comment 2 Maxime Daniel CLA 2007-09-17 09:02:25 EDT
Verified for 3.4 M2 using build I20070917-0010.