groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "death lord (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (GROOVY-8322) Closure disallows for static dispatch of call(Object[])
Date Thu, 01 Feb 2018 12:51:00 GMT

     [ https://issues.apache.org/jira/browse/GROOVY-8322?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

death lord updated GROOVY-8322:
-------------------------------
    Summary: Closure disallows for static dispatch of call(Object[])  (was: call() and call(Object)
on Closure disallows for static dispatch of call(Object[]))

> Closure disallows for static dispatch of call(Object[])
> -------------------------------------------------------
>
>                 Key: GROOVY-8322
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8322
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 3.0.0-alpha-1
>            Reporter: death lord
>            Priority: Major
>
> I have something like this:
> {code:java}
> @groovy.transform.CompileStatic
> class A {
>     Closure x
>     def call(...args) {
>         x.call((Object[]) args)
>     }
>     static main(w) {
>         def a = new A(x: { ...args -> println(args[0].toString()) })
>         a(1, 2, 3)
>     }
> }
> {code}
> And the output is [1, 2, 3].
> If I remove CompileStatic the output is 1.
> I think the culprit is the call(Object) method in Closure



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message