Bug 77078 - [1.5] spurious "type not applicable for the arguments" error
Summary: [1.5] spurious "type not applicable for the arguments" error
Status: RESOLVED DUPLICATE of bug 73963
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M3   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-27 02:17 EDT by Joe Bowbeer CLA
Modified: 2004-10-27 04:14 EDT (History)
0 users

See Also:


Attachments

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