You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2019/02/21 06:19:02 UTC
[jira] [Closed] (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 ]
Paul King closed GROOVY-5852.
-----------------------------
> 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)