Bug 81571

Summary: Autoboxing ambiguousy
Product: [Eclipse Project] JDT Reporter: Mads Andersen <madsie>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M5   
Hardware: All   
OS: All   
Whiteboard:

Description Mads Andersen CLA 2004-12-17 17:49:16 EST
Here's an example that compiles with javac, but fails with the Eclipse compiler:

---8<---
package a;

public class A {

    public void a(int a, int b) {
    }

    public void a(Object a, Object b) {
    }

    public void b() {
        Integer i = 1;
        a(i, 2);
    }
}
---8<---

The error reported by Eclipse is:

The method a(int, int) is ambiguous for the type A
Comment 1 Kent Johnson CLA 2005-01-05 16:34:52 EST
Added Autoboxing test073
Comment 2 Kent Johnson CLA 2005-01-06 11:06:48 EST
Just tried with the latest javac 1.5.0_01 drop & our original behaviour was 
correct.

The message send should be ambiguous since the exact match after autoboxing 
does not take precedence over other compatible matches.

Reverted back to our original behaviour.
Comment 3 David Audel CLA 2005-02-15 12:59:14 EST
Verified in I20050214-0927