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

Shil Sinha commented on GROOVY-7688:
------------------------------------

As John mentioned, this is a more general case of the bug in GROOVY-7656. 
Receivers for spread safe method calls are visited twice - once as a receiver 
of the spread safe method call, and once as a receiver of the iterator of the 
resulting for loop. 

> Using spread operator on function with compile static results in two calls to 
> function
> --------------------------------------------------------------------------------------
>
>                 Key: GROOVY-7688
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7688
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.4.5
>            Reporter: MichaƂ Lewandowski
>            Priority: Minor
>
> Method *heavyOperation()* will be called twice. If we remove @CompileStatic, 
> problem is solved.
> {noformat}
>     @CompileStatic
>     List<String> invokeCompileStatic(Service service){
>         service.heavyOperation()*.toString()
>     }
> {noformat}
> A test which confirms it, can be found in [my 
> Gist|https://gist.github.com/mlevvy/948e13414be360a20212]



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

Reply via email to