Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Duplicate
-
None
-
None
-
None
Description
I have the following program
interface A { default void m() { System.out.println("here"); } } interface B { default void m() { System.out.println("there") } } interface C extends B, A {} class Test implements C { public void test() { this.m(); } public static void main(String[] args) { Test x = new Test(); x.test(); } }
Actual behavior
The code compiles, but there's a runtime error
Exception in thread "main" java.lang.AbstractMethodError: Receiver class Test does not define or inherit an implementation of the resolved method 'void m()' of interface B. at Test.test(groovy109.groovy:17) at Test.main(groovy109.groovy:22)
Expected behavior
The code should have been rejected
Attachments
Issue Links
- duplicates
-
GROOVY-10381 No compiler error for class that implements interfaces with duplicated default methods
- Open