You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2021/07/27 22:38:00 UTC

[jira] [Comment Edited] (GROOVY-10185) Static compilation issue between static and non static methods

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

Paul King edited comment on GROOVY-10185 at 7/27/21, 10:37 PM:
---------------------------------------------------------------

Same behavior on master branch. Possibly related to GROOVY-9918.


was (Author: paulk):
Same behavior on master branch.

> Static compilation issue between static and non static methods
> --------------------------------------------------------------
>
>                 Key: GROOVY-10185
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10185
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static compilation
>    Affects Versions: 3.0.8
>            Reporter: James Kleeh
>            Priority: Major
>
> The following code fails with the exception 
>  
> {code:java}
> ideaGroovyConsole.groovy: 19: [Static type checking] - Non static method Bar#run cannot be called from static context
>  @ line 19, column 17.
>  println Bar.run(Foo){code}
>  
>  
> {code:java}
> import groovy.transform.CompileStatic
> class Bar {
>     static String run(Class cls, String... args) { return "ok" }
>     void run(Class type) {}
> }
> @CompileStatic
> class Foo {
>     static void go() { println Bar.run(Foo) }
> }
> Foo.go()
> {code}
>  This worked in Groovy 3.0.7
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)