You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2019/11/13 07:41:00 UTC

[jira] [Updated] (GROOVY-9294) SC: array length not available within closure

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

Paul King updated GROOVY-9294:
------------------------------
    Fix Version/s: 2.5.9

> SC: array length not available within closure
> ---------------------------------------------
>
>                 Key: GROOVY-9294
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9294
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Minor
>             Fix For: 2.5.9, 3.0.0-rc-2
>
>
> Consider the following:
> {code:groovy}
> class C {
>   @groovy.transform.CompileStatic
>   void meth(String[] strings) {
>     strings.with {
>       println length
>     }
>   }
> }
> {code}
> Compiler currently emits error "The variable [length] is undeclared." because the object expression type is {{C}} and not {{String[]}} (see {{StaticTypeCheckingVisitor#existsProperty}}).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)