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

Paul King commented on GROOVY-8574:
-----------------------------------

See my comment for GROOVY-8573. Also, Groovy truth is applied, e.g.:
{code:java}
assert (3..5).every{ it + 1 }
{code}
Here it is {{Closure<Integer>}}.

> Add type parameterization and @ClosureParams to each/every/etc. Object 
> variants
> -------------------------------------------------------------------------------
>
>                 Key: GROOVY-8574
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8574
>             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
>
> Similar to GROOVY-8573, there are a few DGMs that operate on "anything that 
> can be converted to an iterator", ex: {{every(Object,Closure)}}.  Would it be 
> safe to convert these to type-parameterized methods to allow proper 
> {{@ClosureParams}} tagging?
> Ex:
> {code:java}
> public static boolean every(Object self, Closure closure)
>  // becomes:
> public static <T> boolean every(T self, 
> @ClosureParams(value=FromString.class, options={"T"}) Closure closure)
> {code}
> I think this is binary-compatible with the old signature since the T is 
> erased at compile time.



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

Reply via email to