Bug 88094 - [1.5] compiler accepts two methods with same erasure
Summary: [1.5] compiler accepts two methods with same erasure
Status: VERIFIED FIXED
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 M6   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-15 14:00 EST by Markus Keller CLA
Modified: 2005-03-30 19:07 EST (History)
0 users

See Also:


Attachments

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