Bug 80590

Summary: compiler error "name clash" with generics and erasure/inheritance
Product: [Eclipse Project] JDT Reporter: mike andrews <mikea>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description mike andrews CLA 2004-12-09 08:29:21 EST
get a compiler error in 3.1M3 with the following interface and implementation,
"Name clash : The method getMap() of type TestInterfaceImpl<A,B> has the same
erasure as getMap() of type TestInterface but does not override it
TestInterfaceImpl.java"
"

here are TestInterface and TestInterfaceImpl that cause this error:

public interface TestInterface<A, B> {

    public A getA();

    public B getB();

    public Map<String, String> getMap();

}


public class TestInterfaceImpl<A,B> implements TestInterface {

    public A getA() {
        return null;
    }

    public B getB() {
        return null;
    }

    // *** THIS METHOD IS FLAGGED WITH COMPILER ERROR
    public Map<String,String> getMap() {
        return null;
    }

}
Comment 1 Jerome Lanneluc CLA 2004-12-10 01:33:34 EST
Thanks for the test case. Verified this now works with HEAD.