Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 390883 - [1.8][compiler] Unable to override default method
Summary: [1.8][compiler] Unable to override default method
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.8   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: BETA J8   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 380501
  Show dependency tree
 
Reported: 2012-10-02 01:41 EDT by Srikanth Sankaran CLA
Modified: 2013-01-26 17:38 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 Srikanth Sankaran CLA 2012-10-02 01:41:04 EDT
BETA_JAVA8:

The following program fails to compile with TOT while javac 8b56 compiles
fine. I believe the right behavior is to compile it:

// -----------------
public interface X extends Map<String, Object> {
}

interface Map<K,V> extends MapStream<K, V>  {
   @Override
	Iterable<BiValue<K, V>> asIterable() default {
       return null;
   }
}
interface MapStream<K, V> {
	Iterable<BiValue<K, V>> asIterable() default {
       return null;
   }
}

interface BiValue<T, U> {
    T getKey();
    U getValue();
}
Comment 1 Srikanth Sankaran CLA 2012-10-02 01:44:06 EDT
Stephan, please take a look: I have added a disabled regression test
via DefaultMethodsTest._testDefaultNonclash3()

The emitted message is:

Duplicate methods named asIterable with the parameters () and () are inherited from the types Map<String,Object> and MapStream<String,Object>
Comment 2 Stephan Herrmann CLA 2013-01-26 17:38:22 EST
Fix has been released for BETA_JAVA8 via commit 6545e2eba728ce5d7f114b77afe5ab08a731f692.