[
https://issues.apache.org/jira/browse/GROOVY-9813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543513#comment-17543513
]
Eric Milles edited comment on GROOVY-9813 at 5/28/22 11:00 PM:
---------------------------------------------------------------
https://github.com/apache/groovy/commit/2b6db817e3c12fea5d028d6a0bc984a91b7119b2
https://github.com/apache/groovy/commit/02d1a3b4f76f1311eb2286188b224cfbbf0324db
was (Author: emilles):
https://github.com/apache/groovy/commit/2b6db817e3c12fea5d028d6a0bc984a91b7119b2
> Support matching functional interface to variadic method reference
> ------------------------------------------------------------------
>
> Key: GROOVY-9813
> URL: https://issues.apache.org/jira/browse/GROOVY-9813
> Project: Groovy
> Issue Type: Improvement
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
> Labels: varargs
> Fix For: 5.0.0-alpha-1
>
>
> Java supports each of the following functional interface assignments for a
> variadic method like {{java.util.Arrays#asList}}.
> {code:groovy}
> import java.util.function.*
> @groovy.transform.CompileStatic
> void test() {
> Supplier<List> zero = Arrays::asList
> Function<Integer, List> one = Arrays::asList
> BiFunction<Integer, Integer, List> two = Arrays::asList
> }
> {code}
> Note: Groovy compiler only produces error for first incompatible method
> reference.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)