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

Eric Milles commented on GROOVY-11180:
--------------------------------------

If you add "public", "protected" or "private" you get a {{FieldNode}} and no 
{{PropertyNode}}.  Only "{{@PackageScope Type name}}" is a property that will 
get converted to a field by the end of semantic analysis.

> 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, 4.0.16
>
>
> 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