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/23 03:29:00 UTC

[jira] [Resolved] (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 resolved GROOVY-9991.
---------------------------------
    Fix Version/s: 4.0.0-alpha-3
       Resolution: Fixed

> 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
>             Fix For: 4.0.0-alpha-3
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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)