report unrelated defaults when 2 default methods provided; abstract/default otherwise (IDEA-141714)

This commit is contained in:
Anna Kozlova
2015-06-22 18:26:32 +03:00
parent 6bc7f0b207
commit 6fd53851a0
4 changed files with 14 additions and 3 deletions

View File

@@ -10,4 +10,4 @@ interface A5 {
Iterator iterator();
}
abstract class <error descr="B inherits unrelated defaults for iterator() from types A5 and A4">B</error> implements A5, A4 {}
abstract class <error descr="B inherits abstract and default for iterator() from types A5 and A4">B</error> implements A5, A4 {}

View File

@@ -1,3 +1,14 @@
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 {}
interface E {
default void foo() {
}
}
interface F {
void foo();
}
interface <error descr="G inherits abstract and default for foo() from types E and F">G</error> extends E, F {}

View File

@@ -12,7 +12,7 @@ interface SecondParent {
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 <error descr="SecondSon inherits unrelated defaults for doSomething() from types SecondParent and FirstParent">SecondSon</error> implements SecondParent, FirstParent</error> {}
<error descr="Class 'SecondSon' must either be declared abstract or implement abstract method 'doSomething()' in 'SecondParent'">class <error descr="SecondSon inherits abstract and default for doSomething() from types SecondParent and FirstParent">SecondSon</error> implements SecondParent, FirstParent</error> {}
interface A {
default int foo() {