You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2025/01/26 18:00:00 UTC
[jira] [Assigned] (GROOVY-11560) Invalid compiler error for class which overrides a method having duplicate default definitions from interfaces
[ https://issues.apache.org/jira/browse/GROOVY-11560?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles reassigned GROOVY-11560:
------------------------------------
Assignee: Paul King (was: Daniel Sun)
> Invalid compiler error for class which overrides a method having duplicate default definitions from interfaces
> --------------------------------------------------------------------------------------------------------------
>
> Key: GROOVY-11560
> URL: https://issues.apache.org/jira/browse/GROOVY-11560
> Project: Groovy
> Issue Type: Bug
> Reporter: Eric Milles
> Assignee: Paul King
> Priority: Major
> Labels: default-methods
>
> This is a clone of GROOVY-10381 which solved 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.
> As noted in that issue, the following case isn't covered:
> {code:groovy}
> import package p.*
> class C implements A, B {
> @Override
> void m() {
> A.super.m()
> }
> void test() {
> m()
> }
> }
> {code}
> The intention of this issue is to cover that missing case.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)