Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
I have the following ill-typed program
interface A { int m(); } class C implements A { public int m() { return 1; } void test() { A.super.m(); } } public class Test { public static void main(String[] args) { new C().test(); } }
Actual behavior
The program compiles with and produces:
Exception in thread "main" java.lang.AbstractMethodError: 'int A.m()' at C.test(Test.groovy:8) at Test.main(Test.groovy:14)
Expected behavior
Reject the program with:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Test.groovy: 8: [Static type checking] - Abstract method m() cannot be called directly
@ line 8, column 9.
A.super.m();
^
1 error
Attachments
Issue Links
- is related to
-
GROOVY-8299 Generate bytecode for interface with default, private and static methods
- Closed