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 2017/07/22 17:16:00 UTC
[jira] [Commented] (GROOVY-7995) Short syntax of closure call
invokes wrong closure if wrapped in another closure and @CompileStatic is
applied
[ https://issues.apache.org/jira/browse/GROOVY-7995?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16097384#comment-16097384 ]
ASF GitHub Bot commented on GROOVY-7995:
----------------------------------------
GitHub user jwagenleitner opened a pull request:
https://github.com/apache/groovy/pull/576
GROOVY-7995: @CS closure call from closure
Short syntax of closure call invokes wrong closure if wrapped in another
closure. This fix includes a combination of the contributed commit from
PR #460 along with the patch (see PR comments) provided by Jochen.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jwagenleitner/groovy pr460
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/groovy/pull/576.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 #576
----
commit 8916d43f298d26814c664555cae1a800e2cbfe5b
Author: John Wagenleitner <jw...@apache.org>
Date: 2017-07-22T17:06:21Z
GROOVY-7995: @CS closure call from closure
Short syntax of closure call invokes wrong closure if wrapped in another
closure. This fix includes a combination of the contributed commit from
PR #460 along with the patch (see PR comments) provided by Jochen.
Thanks for @blindpirate for the contribution.
----
> Short syntax of closure call invokes wrong closure if wrapped in another closure and @CompileStatic is applied
> --------------------------------------------------------------------------------------------------------------
>
> Key: GROOVY-7995
> URL: https://issues.apache.org/jira/browse/GROOVY-7995
> Project: Groovy
> Issue Type: Bug
> Components: Static compilation
> Affects Versions: 2.4.7
> Reporter: Krzysztof Kowalczyk
>
> The following would fail:
> {code}
> import groovy.transform.CompileStatic
> @CompileStatic
> class Foo {
> Closure c = { "ok" }
> Closure wrap = {
> c()
> }
> def run(){
> wrap()
> }
> }
> assert new Foo().run() == "ok" // stack overflow
> {code}
> It works fine without CompileStatic or if invokation is done by c.call()
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)