You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Pascal Schumacher (JIRA)" <ji...@apache.org> on 2015/10/31 13:48:27 UTC

[jira] [Closed] (GROOVY-7651) groovysh always raise "Unknown property: a" for a normal ArrayLIst

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

Pascal Schumacher closed GROOVY-7651.
-------------------------------------
    Resolution: Not A Problem
      Assignee: Pascal Schumacher

Hi roroc,

groovy shell variables are untyped. You can write just

{quote}
groovy:000> a = []
===> []
groovy:000> a
===> []
{quote}

see [http://docs.groovy-lang.org/docs/next/html/documentation/#GroovyShell-Variables] for details.

If you want to use typed variables or def you can switch to interpreter mode:

{quote}
groovy:000> :set interpreterMode
groovy:000> def a = []
===> []
groovy:000> a
===> []
{quote}

[http://docs.groovy-lang.org/docs/next/html/documentation/#GroovyShell-Variables], but be warned that this mode has some know bugs in 2.4.x (which will be fixed in 2.5).

> groovysh always raise "Unknown property: a" for a normal ArrayLIst
> ------------------------------------------------------------------
>
>                 Key: GROOVY-7651
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7651
>             Project: Groovy
>          Issue Type: Bug
>          Components: Groovysh
>    Affects Versions: 2.4.3
>            Reporter: roroco
>            Assignee: Pascal Schumacher
>
> reproduction:
> roroco@roroco-Zhaoyang-K49 /media/roroco/disk750/records $ groovysh
> Groovy Shell (2.4.3, JVM: 1.8.0_60)
> Type ':help' or ':h' for help.
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> groovy:000> def a = []
> ===> []
> groovy:000> a
> Unknown property: a



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)