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 2022/04/21 23:44:00 UTC

[jira] [Comment Edited] (GROOVY-10591) Static method not found on Java interface

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

Eric Milles edited comment on GROOVY-10591 at 4/21/22 11:43 PM:
----------------------------------------------------------------

You need a qualifier to call an interface static method outside of the declaring interface. 


was (Author: emilles):
You need a qualifier to call an interface static method outside of that interface. 

> Static method not found on Java interface
> -----------------------------------------
>
>                 Key: GROOVY-10591
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10591
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 4.0.1, 4.0.2
>            Reporter: Lóránt Pintér
>            Priority: Major
>
> The following code works with Groovy 3.0.10, but fails with Groovy 4.0.1:
> [https://gist.github.com/lptr/424bfd3e95cd51df03ff67c2ae76cebc]
> The failure is as follows:
> {code}
> Caught: groovy.lang.MissingMethodException: No signature of method: Geza.staticMethod() is applicable for argument types: (String) values: [Hello]
> Possible solutions: instanceMethod(java.lang.String)
> groovy.lang.MissingMethodException: No signature of method: Geza.staticMethod() is applicable for argument types: (String) values: [Hello]
> Possible solutions: instanceMethod(java.lang.String)
>         at Geza.instanceMethod(Geza.groovy:4)
>         at script.run(script.groovy:1)
>         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> {code}



--
This message was sent by Atlassian Jira
(v8.20.7#820007)