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 2021/10/25 15:50:00 UTC
[jira] [Resolved] (GROOVY-8054) Static imports inconsistency with
@CompileStatic and use()
[ https://issues.apache.org/jira/browse/GROOVY-8054?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles resolved GROOVY-8054.
---------------------------------
Resolution: Fixed
> Static imports inconsistency with @CompileStatic and use()
> ----------------------------------------------------------
>
> Key: GROOVY-8054
> URL: https://issues.apache.org/jira/browse/GROOVY-8054
> Project: Groovy
> Issue Type: Bug
> Components: Compiler, Static compilation
> Affects Versions: 2.4.8
> Reporter: Daniil Ovchinnikov
> Assignee: Eric Milles
> Priority: Major
>
> {code}
> package hello
> import groovy.transform.CompileStatic
> import static hello.C.*
> class C {
> static foo(a) { 'imported foo' }
> static bar(a) { 'imported bar' }
> }
> class Main {
> static void main(String[] args) {
> def main = new Main()
> println main.foo1() // imported foo
> println main.bar1() // class bar
> use(Main) {
> println main.bar1() // imported bar
> }
> }
> @CompileStatic
> def foo1() {
> foo '2'
> }
> def bar1() {
> bar '2'
> }
> static foo(String s) { 'class foo' }
> static bar(String s) { 'class bar' }
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)