[
https://issues.apache.org/jira/browse/GROOVY-11092?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17731773#comment-17731773
]
Eric Milles edited comment on GROOVY-11092 at 6/13/23 6:04 PM:
---------------------------------------------------------------
https://github.com/apache/groovy/commit/15be6d972a00103431e798d0656aa9f517b4e70c
https://github.com/apache/groovy/commit/cac91791764b8f0b3338318248474412f89e3456
https://github.com/apache/groovy/commit/cba20a0afe3bec185db87c20b769ad37c8180b30
was (Author: emilles):
https://github.com/apache/groovy/commit/15be6d972a00103431e798d0656aa9f517b4e70c
https://github.com/apache/groovy/commit/cac91791764b8f0b3338318248474412f89e3456
> STC: support coerced closure argument destructuring (for list and tuple)
> ------------------------------------------------------------------------
>
> Key: GROOVY-11092
> URL: https://issues.apache.org/jira/browse/GROOVY-11092
> Project: Groovy
> Issue Type: Improvement
> Components: Static Type Checker
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
> Fix For: 5.0.0-alpha-1
>
>
> Consider the following:
> {code:groovy}
> import java.util.function.Consumer
> import static groovy.lang.Tuple.tuple
> @groovy.transform.TypeChecked test() {
> Consumer<Tuple3<String,Number,?>> c = { x, y, z -> print y }
> c.accept(tuple("",(Number)42,null))
> }
> test()
> {code}
> STC error: "Wrong number of parameters for method target
> {{accept(groovy.lang.Tuple3<java.lang.String, java.lang.Number, ?>)}}"
> This kind of list/tuple destructuring is supported by the dynamic runtime
> (see {{ClosureMetaClass}}).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)