You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/01/02 22:57:00 UTC

[jira] [Commented] (GROOVY-8430) @Field doesn't support final fields

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

ASF GitHub Bot commented on GROOVY-8430:
----------------------------------------

GitHub user paulk-asert opened a pull request:

    https://github.com/apache/groovy/pull/652

    fix for: GROOVY-8430: @Field doesn't support final fields

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/paulk-asert/groovy groovy8430

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/groovy/pull/652.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #652
    
----
commit f8a3b9034ce2578199da87b1580aad7d2903a072
Author: paulk <pa...@...>
Date:   2018-01-02T22:55:35Z

    fix for: GROOVY-8430: @Field doesn't support final fields

----


> @Field doesn't support final fields
> -----------------------------------
>
>                 Key: GROOVY-8430
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8430
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Paul King
>
> We do slightly stricter checking of final modifiers for fields in 2.5 but @Field has problems with code like this:
> {code}
> @Field final foo = 42
> {code}
> giving the error:
> {noformat}
> cannot modify final field 'foo' outside of constructor.
> {noformat}
> It turns out the {{setFoo}} method we create as a helper method shouldn't be created for the final case.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)