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

Xiaotian Ma commented on GROOVY-11548:
--------------------------------------

Oh, the new solution works, thanks a lot. But let's think further. If I have a 
Java function that takes class A as a parameter, it doesn't seem to work again 
because I could not pass B into it.
{code:java}
public static void func(A a) {
    a.func();
} {code}

> Could not inherit class and interface where class has a final method 
> overridden by interface
> --------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-11548
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11548
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 4.0.24
>         Environment: Tried on Linux and Windows, the same error.
>            Reporter: Xiaotian Ma
>            Assignee: Paul King
>            Priority: Major
>             Fix For: 5.0.0-alpha-11
>
>         Attachments: image-2025-01-07-22-03-27-530.png, 
> image-2025-01-07-22-07-18-268.png, image-2025-01-07-22-10-11-698.png
>
>
> Compile following code.
> {code:groovy}
> class A {
>     final public void func() {
>     }
> }
> interface I0 {
>     public default void func() {
>     }
> }
> class B extends A implements I0 {
> }{code}
> Groovy 4.0.24:
> {code:java}
> A.groovy: -1: You are not allowed to override the final method func() from 
> class 'A'.
> @ line -1, column -1.
> 1 error{code}
> Groovy 5.0.0-alpha-11: passed



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

Reply via email to