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 17:42:00 UTC
[jira] [Commented] (GROOVY-9294) SC: array length not available
within closure
[ https://issues.apache.org/jira/browse/GROOVY-9294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16962266#comment-16962266 ]
Eric Milles commented on GROOVY-9294:
-------------------------------------
Fixed by commit https://github.com/apache/groovy/commit/dfdd326f004680aa74e3e52538c2cb0e8f4a8b70
> 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
>
> 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)