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:28:00 UTC

[jira] [Created] (GROOVY-8574) Add type parameterization and @ClosureParams to each/every/etc. Object variants

Eric Milles created GROOVY-8574:
-----------------------------------

             Summary: 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: Bug
    Affects Versions: 2.5.0-rc-2, 2.4.15, 3.0.0-alpha-2, 2.6.0-alpha-3
            Reporter: Eric Milles


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)