[
https://issues.apache.org/jira/browse/GROOVY-11089?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles resolved GROOVY-11089.
----------------------------------
Resolution: Fixed
https://github.com/apache/groovy/commit/68e16ff561a75ac84c465c127221a46108a84419
> STC: closure param type inference for array and list
> ----------------------------------------------------
>
> Key: GROOVY-11089
> URL: https://issues.apache.org/jira/browse/GROOVY-11089
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Affects Versions: 4.0.12
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
>
> Consider the following:
> {code:groovy}
> @groovy.transform.TypeChecked
> void test() {
> (new String[]{'a','b'}).with { a, b -> } // throws MissingMethodException
> ['a','b'].with { a, b -> } // param count error
> }
> test()
> {code}
> 1. STC thinks it can spread array elements across closure parameters, but
> this does not work.
> 2. STC thinks it cannot spread list elements across closure parameters, which
> does work (if length check is lifted).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)