Eric Milles created GROOVY-11089:
------------------------------------
Summary: 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
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 acress closure parameters, which
does work.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)