Bug 80739 - [1.5] Two methods ends up with the same signatures
Summary: [1.5] Two methods ends up with the same signatures
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 M4   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-10 17:27 EST by Olivier Thomann CLA
Modified: 2004-12-15 20:31 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2004-12-10 17:27:47 EST
Using latest, that code compiles fine, but it should fail because two methods
are inherited with the same signature.

class A<T> {
    void foo(T t) {}
    void foo(String i) {}
}

public class X<T> extends A<String> {}

If you change it for:
class A<T> {
    void foo(T t) {}
    void foo(String i) {}
}

public class X<T> extends A<String> {
	public static void main(String[] args) {
		new X<String>().foo("");
	}
}

We do report an ambiguous call.
----------
1. ERROR in C:\tests_sources\X.java (at line 8)
	new X<String>().foo("");
	                ^^^
The method foo(String) is ambiguous for the type X<String>
----------
1 problem (1 error)
Comment 1 Kent Johnson CLA 2004-12-13 11:47:15 EST
*** Bug 80028 has been marked as a duplicate of this bug. ***
Comment 2 Kent Johnson CLA 2004-12-14 13:12:15 EST
Added MethodVerify test023
Comment 3 Kent Johnson CLA 2004-12-15 15:21:35 EST
fixed.
Comment 4 Olivier Thomann CLA 2004-12-15 20:31:06 EST
Verified in 200412160010