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:30:00 UTC
[jira] [Updated] (GROOVY-8574) Add type parameterization and
@ClosureParams to each/every/etc. Object variants
[ https://issues.apache.org/jira/browse/GROOVY-8574?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles updated GROOVY-8574:
--------------------------------
Issue Type: Improvement (was: Bug)
> 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)