[ 
https://issues.apache.org/jira/browse/GROOVY-10185?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Kleeh updated GROOVY-10185:
---------------------------------
    Description: 
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}
 

 

  was:
The following code fails with the exception 

```

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)

```

 

```

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()

```


> 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 message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to