groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul King (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (GROOVY-6351) Static type checking error when accessing static members of a primitive type
Date Thu, 06 Oct 2016 22:52:20 GMT

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

Paul King closed GROOVY-6351.
-----------------------------

> Static type checking error when accessing static members of a primitive type
> ----------------------------------------------------------------------------
>
>                 Key: GROOVY-6351
>                 URL: https://issues.apache.org/jira/browse/GROOVY-6351
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>    Affects Versions: 2.1.7, 2.3.0, 2.4.0-rc-1
>            Reporter: Rodolfo Cruz
>             Fix For: 2.4.1
>
>         Attachments: Testcases.groovy
>
>
> The issue is the following. If I declare a variable of a Java primitive type (for example
an int) and try to access a static field in a type checked annotated method (such as MAX_VALUE),
there is a failure stating '[Static type checking] - No such property: MAX_VALUE for class:
int'. An example of this could be:
> {code}
> @groovy.transform.TypeChecked
> void runMethod (){
> int i = 10
> println(i.MAX_VALUE)
> }
> runMethod()
> {code}
> However, running the same snippet without the annotation works fine. This happens as
far as I know with all primitive types.
> I don't know if the previous code is correct, given that as a primitive type you don't
have static fields, and they only appear in runtime because of autoboxing, but I think there
should be a consistency between the two situations.
> Furthermore, I think this might be related with issue GROOVY-6349.
> I attach some examples to use as test cases.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message