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 2015/06/01 13:56:17 UTC

[jira] [Resolved] (GROOVY-6212) SpreadExpression BUG! when slicing a List

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

Paul King resolved GROOVY-6212.
-------------------------------
       Resolution: Fixed
    Fix Version/s: 2.5.0-beta-1
         Assignee: Paul King

Thanks for spotting the problem and raising the issue.

> SpreadExpression BUG! when slicing a List
> -----------------------------------------
>
>                 Key: GROOVY-6212
>                 URL: https://issues.apache.org/jira/browse/GROOVY-6212
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.1.5, 2.4.0-rc-1
>            Reporter: Alexey Rusakovich
>            Assignee: Paul King
>             Fix For: 2.5.0-beta-1
>
>
> Evaluating
> {code}
> (1..3)[*0..2]
> {code}
> throws: {{BUG! exception in phase 'class generation' in source unit 'ConsoleScript42' SpreadExpression should not be visited here}}
> It works fine if I manually call {{getAt}}:
> {code}
> (1..3).getAt([*0..2]) // [1, 2, 3]
> {code}
> It also works if I add something besides the spread:
> {code}
> (1..3)[*0..2, 2] // [1, 2, 3, 3]
> {code}
> as shown in the Ranges and List-Slicing section of [Getting Started Guide > Collections|http://groovy.codehaus.org/JN1015-Collections].
> There are other SpreadExpression BUG!s, but I'm not sure if this bug is the same:
> http://jira.codehaus.org/issues/?jql=text%20%7E%20%22SpreadExpression%22



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