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

Array.length not working

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-beta-5
    • 1.0-beta-8
    • class generator
    • None
    • xp and latest CVS

    Description

      Object[] ss = new Object[]

      {'hello'}

      Object[] is = new Object[]

      {new Integer(1)}

      println ss.length
      // this returns a MethodClosure instead of 1
      println is.length
      // runtime error: no such property length on Integer

      "length" should simply return the length of the array. The first case treats length as a MethodClosure and the second as a property (the property thing hit back again)

      Attachments

        Activity

          People

            jstrachan James Strachan
            bingran Bing Ran
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: