You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (JIRA)" <ji...@apache.org> on 2018/05/08 15:39:00 UTC

[jira] [Commented] (GROOVY-8573) Add @ClosureParams to each/eachWithIndex methods in DefaultGroovyMethods

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

Eric Milles commented on GROOVY-8573:
-------------------------------------

Or is this a case of unable to determine what kind if iterator any given object may result in due to dynamic Groovy?

> Add @ClosureParams to each/eachWithIndex methods in DefaultGroovyMethods
> ------------------------------------------------------------------------
>
>                 Key: GROOVY-8573
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8573
>             Project: Groovy
>          Issue Type: Improvement
>    Affects Versions: 2.6.0-alpha-3, 3.0.0-alpha-2, 2.4.15, 2.5.0-rc-2
>            Reporter: Eric Milles
>            Priority: Minor
>
> Category methods {{each(T,Closure)}} and {{eachWithIndex(T,Closure)}} are missing {{@ClosureParams}} annotations.
> From some cursory testing, it looks like these are the necessary additions:
> {code:java}
> public static <T> T each(T self, @ClosureParams(value=FromString.class, options={"T"}) Closure closure)
> public static <T> T eachWithIndex(T self, @ClosureParams(value=FromString.class, options="T,Integer") Closure closure)
> {code}



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