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 2021/03/20 00:55:00 UTC

[jira] [Assigned] (GROOVY-9991) STC: error for closure not matching functional interface method's parameter count

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

Eric Milles reassigned GROOVY-9991:
-----------------------------------

    Assignee: Eric Milles

> STC: error for closure not matching functional interface method's parameter count
> ---------------------------------------------------------------------------------
>
>                 Key: GROOVY-9991
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9991
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Major
>
> Consider the following:
> {code:groovy}
> import java.util.function.*
> @groovy,transform.TypeChecked
> void test() {
>   Consumer c0 = { print it } // error
>   Consumer c1 = { x -> } // all good
>   Supplier s0 = { -> "" } // all good
>   Supplier s1 = { "" } // all good
> }
> {code}
> The implicit parameter closure literal (no arrow) should match for 0 or 1 parameter method targets.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)