Eric Milles created GROOVY-11378:
------------------------------------

             Summary: array or collection coercion of non-collection iterable 
produces single-element result
                 Key: GROOVY-11378
                 URL: https://issues.apache.org/jira/browse/GROOVY-11378
             Project: Groovy
          Issue Type: Bug
          Components: groovy-jdk
    Affects Versions: 5.0.0-alpha-8, 4.0.0, 3.0.0
            Reporter: Eric Milles
            Assignee: Eric Milles


Consider the following:
{code:groovy}
@Grab('org.apache.commons:commons-collections4:4.4')
import org.apache.commons.collections4.FluentIterable

def iterable = FluentIterable.of(['foo','bar','baz'])
def array = iterable as String[]
print array.length
{code}

This script prints "1".  We are expecting an array of 3 strings.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to