[jira] [Commented] (GROOVY-7879) Groovy calls wrong method if there is a static method on an interface

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[jira] [Commented] (GROOVY-7879) Groovy calls wrong method if there is a static method on an interface

JIRA jira@apache.org

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

ASF GitHub Bot commented on GROOVY-7879:
----------------------------------------

Github user asfgit closed the pull request at:

    https://github.com/apache/groovy/pull/521


> Groovy calls wrong method if there is a static method on an interface
> ---------------------------------------------------------------------
>
>                 Key: GROOVY-7879
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7879
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.4.7
>            Reporter: Stefan Wolf
>
> If there is an interface having the static method {{foo}} and a class {{Impl}} implementing this interface also having a static method {{foo}}, then calling {{Impl.foo()}} calls the method on the interface. For an easy self contained example have a look at https://github.com/wolfs/groovy-static-interface-method-test/blob/master/src/test/groovy/StaticInterfaceTest.groovy.
> This can yield class cast exceptions on Java 8 and from Java 9 build 125 onwards this yields
> {code}
> java.lang.IncompatibleClassChangeError: Method ... must be InterfaceMethodref constant
> {code}
> This verification has been introduced here: https://bugs.openjdk.java.net/browse/JDK-8145148.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
Loading...