Bug 59743

Summary: [Compiler] Incorrect diagnosis of ambiguous method when inheriting
Product: [Eclipse Project] JDT Reporter: Jason Feng <dirtfeng>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.1.2   
Target Milestone: 3.0 M9   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Jason Feng CLA 2004-04-23 00:06:47 EDT
Class T1 and T2 is in seperate file. T2 can not compile in Eclipse. 
But this can be done in JBuilder or javac..
public class T1 {
	public void foo(int p1) {
		System.out.println("p1");
	}
	public void foo(short p1) {
		System.out.println("p2");
	}

}

public class T2 extends T1 {
	public void foo(long p1) {
		System.out.println("p3");
	}
	public void testEc() {
		foo((short)1);
	}
}
Comment 1 Philipe Mulet CLA 2004-04-23 08:07:29 EDT
Reproduced in 3.0.

We indeed incorrectly diagnose an ambiguity:
The method foo(long) is ambiguous for the type T2

but it is a fair error to detect in 1.3 compliant mode. Only in 1.4 compliant 
and subsequent mode must we tolerate it.

Kent - the compliance check must here use: options.complianceLevel.
Comment 2 Kent Johnson CLA 2004-04-23 16:52:48 EDT
Fixed.

Added test075 to Compliance_13 & Compliance_14.
Comment 3 Frederic Fusier CLA 2004-05-19 07:31:11 EDT
Verified for 3.0 M9 with build I200405190010.