You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "James Kleeh (Jira)" <ji...@apache.org> on 2021/07/27 14:10:00 UTC
[jira] [Created] (GROOVY-10185) Static compilation issue between
static and non static methods
James Kleeh created GROOVY-10185:
------------------------------------
Summary: 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
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()
```
--
This message was sent by Atlassian Jira
(v8.3.4#803005)