default methods: check unrelated defaults (IDEA-91685;IDEA-98792)

This commit is contained in:
anna
2013-01-14 14:16:52 +01:00
parent 3a3520a70c
commit 8c431a908a
4 changed files with 63 additions and 0 deletions
@@ -0,0 +1,3 @@
interface B { default void foo() {} }
interface C { default void foo() {} }
class <error descr="D inherits unrelated defaults for foo() from types B and C">D</error> implements B, C {}
@@ -0,0 +1,15 @@
interface FirstParent {
default int doSomething() {
return 1;
}
}
interface SecondParent {
int doSomething();
}
class <error descr="Class 'SecondParent' must either be declared abstract or implement abstract method 'doSomething()' in 'SecondParent'">FirstSon</error> implements FirstParent, SecondParent {}
<error descr="Class 'SecondSon' must either be declared abstract or implement abstract method 'doSomething()' in 'SecondParent'">class SecondSon implements SecondParent, FirstParent</error> {}