Bug 88094

Summary: [1.5] compiler accepts two methods with same erasure
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Markus Keller CLA 2005-03-15 14:00:52 EST
v_541

class C<T> {
    T id(T x) { return x; }
    String id(String x) { return "String " + x; }
}

class Bound<T extends String> extends C<T> {
    T id(T x) { return x; }
    String id(String x) { return x; }
}

Eclipse accepts this code and generates a classfile for Bound, which contains
two methods 'String id(String x)'.

javac rejects method 'String id(String x)' in Bounds with:
- error: id(T) is already defined in p.Bound
- warning: id(java.lang.String) in p.Bound overrides id(T) in p.C; return type
requires unchecked conversion
Comment 1 Frederic Fusier CLA 2005-03-15 15:37:47 EST
Please take care of version when entering a bug, thanks
Comment 2 Kent Johnson CLA 2005-03-16 11:51:32 EST
Added MethodVerify test49
Comment 3 Olivier Thomann CLA 2005-03-30 19:07:54 EST
Verified in 20050330-0500