Bug 77078

Summary: [1.5] spurious "type not applicable for the arguments" error
Product: [Eclipse Project] JDT Reporter: Joe Bowbeer <joe.bowbeer>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Joe Bowbeer CLA 2004-10-27 02:17:27 EDT
Eclipse 3.1M2 will not parse or compile the following code, but JDK1.5 does, and
the construct does appear to be valid.

GenericTest.java line 6:

The method baz(Vector<?>) in the type GenericTest is not applicable for the
arguments (new Vector<Object>(){})

1. import java.util.Vector;
2. public class GenericTest {
3.     public void foo() {
4.         Vector<Object> objectVector = new Vector<Object>() {
5.             protected void bar() {
6.                 baz(this); /* ERROR */
7.             }
8.         };
9.         baz(objectVector);
10.        baz(new Vector<Object>());
11.    }
12.    public void baz(Vector<?> mysteryVector) { }
13.}

Note that lines 9 and 10 compile without error.
Comment 1 Philipe Mulet CLA 2004-10-27 04:14:37 EDT

*** This bug has been marked as a duplicate of 73963 ***