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

Strange coersion bug in Groovy shell

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.5.4
    • 1.5.5, 1.6-beta-1
    • Groovysh
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: