Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 422731 - [1.8] Ambiguous method not reported on overridden default method
Summary: [1.8] Ambiguous method not reported on overridden default method
Status: RESOLVED DUPLICATE of bug 423803
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.4   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: BETA J8   Edit
Assignee: Srikanth Sankaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 380501
  Show dependency tree
 
Reported: 2013-11-28 01:47 EST by Jay Arthanareeswaran CLA
Modified: 2014-01-14 03:31 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jay Arthanareeswaran CLA 2013-11-28 01:47:21 EST
The following code reports only one error, but there should be two. ECJ reports both.

public class X extends Base implements I {

	public static void main(String[] args) {
		X x = new X();
		x.foo((short)5, (short)10);
		x.bar((short)5, (short)10);
	}
	
	public void foo(short s, int i) {} // No error, but should have been
	public void bar(short s, int i) {} // Correctly reported

}

interface I {
	public default void foo(int i, short s) {}
}

class Base {
	public void bar(int i, short s) {}
}
Comment 1 Stephan Herrmann CLA 2013-11-28 07:39:47 EST
I'll take a look.

Two corrections, though:
- the two versions of foo can either be overriding or ambiguous, not both
- "ECJ reports both" should be "javac reports both"
Comment 2 Srikanth Sankaran CLA 2013-12-20 06:46:52 EST
So you can work on G related issues without distraction, I'll take over
this one.
Comment 3 Srikanth Sankaran CLA 2014-01-14 03:31:04 EST
Test released here: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA8&id=041f5c7c1b5d406b904fd03b60472d45690a364f

*** This bug has been marked as a duplicate of bug 423803 ***