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/06/05 19:40: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=16502377#comment-16502377 ] 

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

So is there any hope for type inferencing here?  Could a special {{ClosureSignatureHint}} impl be of service?  Or should this and GROOVY-8574 just be closed?

> 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)