You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2019/10/29 16:36:01 UTC

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

Eric Milles created GROOVY-9294:
-----------------------------------

             Summary: 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


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)