You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by GitBox <gi...@apache.org> on 2021/11/24 18:10:22 UTC

[GitHub] [groovy] eric-milles opened a new pull request #1656: GROOVY-7001: DGM: return exact type for methods accepting collector

eric-milles opened a new pull request #1656:
URL: https://github.com/apache/groovy/pull/1656


   https://issues.apache.org/jira/browse/GROOVY-7001
   
   I stopped short of `collectEntries` methods.  They don't have quite the same problem -- map return is probably okay, whereas the distinction between set, list and collection is often important.
   
   I also changed the return type of some variants to List and added the Collection bridges.
   
   There is some inconsistency between some the variations.  In cases where the input and output types are different, collect (except map variant) is listing the input type first where collectMany and others list input type(s) second.  I did not make any changes (except to use `E` instead of `S`).
   ```java
       <E, T> List<T> collect(E[] self, @ClosureParams(FirstParam.Component.class) Closure<T> transform)
       <T, K, V> List<T> collect(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class) Closure<T> transform)
       <T, E> List<T> collectMany(E[] self, @ClosureParams(FirstParam.Component.class) Closure<...> projection)
       <T, K, V> List<T> collectMany(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class) Closure<...> projection)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [groovy] paulk-asert merged pull request #1656: GROOVY-7001: DGM: return exact type for methods accepting collector

Posted by GitBox <gi...@apache.org>.
paulk-asert merged pull request #1656:
URL: https://github.com/apache/groovy/pull/1656


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org