[jira] [Updated] (GROOVY-9813) Support matching functional interface to variadic method reference

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (GROOVY-9813) Support matching functional interface to variadic method reference

Eric Milles (Jira)

     [ https://issues.apache.org/jira/browse/GROOVY-9813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Milles updated GROOVY-9813:
--------------------------------
    Summary: Support matching functional interface to variadic method reference  (was: Improve support for matching functional interface to variadic method reference)

> Support matching functional interface to variadic method reference
> ------------------------------------------------------------------
>
>                 Key: GROOVY-9813
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9813
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Eric Milles
>            Priority: Major
>
> 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.3.4#803005)