groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-8093) Final variable analysis broken within closure fields
Date Tue, 06 Feb 2018 08:32:00 GMT

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

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

GitHub user paulk-asert opened a pull request:

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

    GROOVY-8093: Final variable analysis broken within closure fields

    

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

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

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

    https://github.com/apache/groovy/pull/659.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 #659
    
----

----


> Final variable analysis broken within closure fields
> ----------------------------------------------------
>
>                 Key: GROOVY-8093
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8093
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.5.x
>            Reporter: Paul King
>            Priority: Major
>
> The following code compiles and runs successfully in 2.4.8 but fails in 2.5 snapshots:
> {code}
> class Foo {
>     public Closure bar = {
>         final RANKINGS = ["year": 0, "month": 10]
>     }
> }
> new Foo().bar()
> {code}
> Error message is:
> {noformat}
> 1 compilation error:
> The variable [RANKINGS] is declared final but is reassigned
> . At [3:9]  at line: 3, column: 9
> {noformat}



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

Mime
View raw message