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

Eric Milles resolved GROOVY-11180.
----------------------------------
    Fix Version/s: 5.0.0-alpha-3
       Resolution: Fixed

https://github.com/apache/groovy/commit/1b07e27db45979417bb110d75215f07c485c5a2f

> Regression: STC loses track of package-scope constants
> ------------------------------------------------------
>
>                 Key: GROOVY-11180
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11180
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>    Affects Versions: 4.0.13, 4.0.14, 4.0.15
>            Reporter: Christopher Smith
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 5.0.0-alpha-3
>
>
> This bug was introduced in 4.0.13.
> I have two classes:
> {code:groovy}
> package bug.repro
> class Constants {
>   @PackageScope static final String CONSTANT = 'foo'
> }
> {code}
> {code:groovy}
> package bug.repro
> import static bug.repro.Constants.CONSTANT
> @groovy.transform.CompileStatic
> class UsesConstants {
>   void run() {
>     println CONSTANT.isEmpty()
>   }
> }
> {code}
> As of 4.0.12, this compiles as expected (would print {{false}}). As of 
> 4.0.13, it produces 
> {code}
> [Static type checking] - Cannot find matching method 
> bug.repro.constants#getCONSTANT(). Please check if the declared type is 
> correct and if the method exists.
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to