Description
Hello!
Consider the following classes.
test/JavaInterface.java
package test; public interface JavaInterface { String doStuff(); }
test/GroovyInterface.groovy
package test interface GroovyInterface extends JavaInterface { default doOtherStuff() { return 'doot' } }
test/GroovyClass.groovy
package test class GroovyClass implements GroovyInterface { @Override String doStuff() { return "otherDoot" } }
This code compiles with an error:
test/GroovyClass.groovy: 4: Method 'doStuff' from class 'test.GroovyClass' does not override method from its superclass or interfaces but is annotated with @Override. @ line 4, column 5. @Override ^
However, removing the default method insideĀ GroovyInterface, OR, declaring GroovyClass to implement both GroovyInterface AND JavaInterface will make compilation succeed again.
Apologies if this is some form of intended behavior, although I suspect it isn't due to the nature of this issue.
Thank You for your time looking into this issue! also thanks for a fantastically flexible language!
Attachments
Issue Links
- is related to
-
GROOVY-8299 Generate bytecode for interface with default, private and static methods
- Closed