You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniel Sun (JIRA)" <ji...@apache.org> on 2019/01/25 17:13:00 UTC

[jira] [Resolved] (GROOVY-5852) Static import on demand resolves capitalised reference

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

Daniel Sun resolved GROOVY-5852.
--------------------------------
       Resolution: Fixed
         Assignee: Daniel Sun
    Fix Version/s: 3.0.0-alpha-5
                   2.5.6

The issue has been fixed already:
https://github.com/apache/groovy/commit/ae463cd8e9a488d501d884598a806ee0d10a8b8a

> Static import on demand resolves capitalised reference
> ------------------------------------------------------
>
>                 Key: GROOVY-5852
>                 URL: https://issues.apache.org/jira/browse/GROOVY-5852
>             Project: Groovy
>          Issue Type: Sub-task
>          Components: Compiler
>            Reporter: Maxim Medvedev
>            Assignee: Daniel Sun
>            Priority: Major
>             Fix For: 2.5.6, 3.0.0-alpha-5
>
>
> get a class 
> {code}
> class Constants {
>   static final pi = 3.14  //final property with implicit getter
> }
> {code}
> and another one
> {code}
> import static Constants.*
> println Pi  // first reference
> println Constants.Pi //second reference
> {code}
> IMHO both references to pi should throw a MissingPropertyException as they have capitalised first letter. Or both of them should not. Now first reference works while the second ref does not.
> BTW if we provide explicit 'public' modifier to pi, both references fail.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)