Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-2689

Strange coersion bug in Groovy shell

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5.4
    • Fix Version/s: 1.5.5, 1.6-beta-1
    • Component/s: Groovysh
    • Labels:
      None
    • Environment:
      Windows XP

      Description

      This expression works properly in Groovy console, but it does not work
      in groovysh:
      [1,2,3] as Object[]

      In groovysh it throws exception:
      ERROR groovy.lang.MissingMethodException: No signature of method:
      org.codehaus.groovy.tools.shell.Groovysh$_cl
      osure1.call() is applicable for argument types: (java.lang.Integer,
      java.lang.Integer, java.lang.Integer) valu
      es:

      {1, 2, 3}

      However,
      [1,2,3] as int[]
      works as expected.

      [1,2,3] as Integer[]
      throws similar exception.

      All these expressions work properly in Groovy console.

        Attachments

          Activity

            People

            • Assignee:
              paulk Paul King
              Reporter:
              enterit Sergey Bondarenko
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: