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 2021/11/23 19:20:00 UTC
[jira] [Closed] (GROOVY-10382) Unable to qualify super in interface default method override
[ https://issues.apache.org/jira/browse/GROOVY-10382?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles closed GROOVY-10382.
--------------------------------
Resolution: Duplicate
GROOVY-9909 describes this condition. I missed the import or qualifier to resolve "A".
> Unable to qualify super in interface default method override
> ------------------------------------------------------------
>
> Key: GROOVY-10382
> URL: https://issues.apache.org/jira/browse/GROOVY-10382
> Project: Groovy
> Issue Type: Bug
> Reporter: Eric Milles
> Priority: Major
> Labels: default-methods
>
> Combination of GROOVY-9909 and GROOVY-10381. Consider the following:
> {code:java}
> package p;
> public interface A {
> default void m() {
> System.out.print("A");
> }
> }
> public interface B {
> default void m() {
> System.out.print("B");
> }
> }
> {code}
> {code:groovy}
> class C implements p.A, p.B {
> void m() {
> A.super.m() // The variable [A] is undeclared
> }
> void test() {
> m()
> }
> }
> {code}
> It is required to override {{m()}} to disambiguate the interface default methods. However, it is not possible to disambiguate the "super" reference with a type qualifier.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)