Summary: | [1.5] Compiler rejects autoboxing-calls to overloaded varargs methods as ambiguous | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Markus Keller <markus.kell.r> |
Component: | Core | Assignee: | Kent Johnson <kent_johnson> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | christoph.lembeck |
Version: | 3.1 | ||
Target Milestone: | 3.1 M6 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Markus Keller
2005-02-16 13:17:47 EST
*** Bug 87142 has been marked as a duplicate of this bug. *** Here is another case: class X { void foo(int... i) {} void foo(Number... n) {} // void foo(Object... o) {} void test() { foo(1); foo(1, new Integer(1)); foo(new Integer(1)); } } All 3 message sends are ambiguous with javac as they are with Eclipse. Number is a superclass of Integer just as Object is. But when foo(Number...) is replaced with foo(Object...) it works. Added AutoBoxing test101 Verified in 20050330-0500 In Eclipse 3.1, we are seeing this behavior again. The two method signatures: protected Object getResult( boolean isBlocking, Object... params ) {...} protected Object getResult( Object... params ) {...} With the following invocation: getResult( isBlocking ); is resulting (no pun intended) in the following error while building: "The method getResult(Object[]) is ambiguous for the type ..." Compiling code via the command line, works fine. |