[
https://issues.apache.org/jira/browse/GROOVY-6022?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul King closed GROOVY-6022.
-----------------------------
> Static type checker should not register errors for ellipsis closure parameter
> annotated with @DelegatesTo
> ---------------------------------------------------------------------------------------------------------
>
> Key: GROOVY-6022
> URL: https://issues.apache.org/jira/browse/GROOVY-6022
> Project: Groovy
> Issue Type: Improvement
> Components: Static Type Checker
> Affects Versions: 2.1.1
> Reporter: Maxim Medvedev
> Assignee: Eric Milles
> Priority: Major
> Labels: varargs
> Fix For: 5.0.0-alpha-1
>
>
> {code}
> def with(@DelegatesTo.Target Object target, @DelegatesTo(strategy =
> Closure.DELEGATE_FIRST) Closure... arg) {
> for (Closure a : arg) {
> a.delegate = target
> a.resolveStrategy = Closure.DELEGATE_FIRST
> a()
> }
> }
> @CompileStatic
> def test() {
> with(a:2) {
> print(get('a')) //false positive error
> } {
> print(get('a')) //false positive error
> }
> }
> test()
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)