You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2021/05/02 09:17:06 UTC
[jira] [Closed] (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 ]
Paul King closed GROOVY-9991.
-----------------------------
> 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: 3.0.8, 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)