[ 
https://issues.apache.org/jira/browse/GROOVY-10381?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17800647#comment-17800647
 ] 

Eric Milles commented on GROOVY-10381:
--------------------------------------

A typical override would look like:
{code:groovy}
import package p.*
class C implements A, B {
  @Override
  void m() {
    A.super.m()
  }
  void test() {
    m()
  }
}
{code}

The "A.super.m()" syntax is rejected by Groovy prior to 5.0a4.

> No compiler error for class that implements interfaces with duplicated 
> default methods
> --------------------------------------------------------------------------------------
>
>                 Key: GROOVY-10381
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10381
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Eric Milles
>            Priority: Major
>              Labels: default-methods
>
> Consider the following:
> {code:java}
> package p;
> public interface A {
>   default void m() {}
> }
> public interface B {
>   default void m() {}
> }
> {code}
> {code:groovy}
> class C implements p.A, p.B {
>   void test() {
>     m()
>   }
> }
> {code}
> {{groovyc}} does not detect that {{m()}} must be overridden to resolve the 
> conflict.  {{javac}} does produce an error, but it is still possible to 
> import the interfaces from libraries and not trigger joint compilation.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to