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

In some cases minus operator does not work with lists

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-beta-10
    • 1.0-JSR-1
    • None
    • None
    • Windows XP Pro. SP2
      Groovy Version: 1.0-beta-10-SNAPSHOT JVM: 1.4.2_06-b03

    Description

      Create a file named bug.groovy with the following content
      //////////////////////////
      class Pair {
      String sym
      }

      l1 = [new Pair(sym:"x"), new Pair(sym:"y")]
      l2 = [new Pair(sym:"y")]
      println (l1 - l2)
      //////////////////////////
      Then run
      groovy bug.groovy

      This will yiled:
      Caught: java.lang.ClassCastException
      at bug.run(C:\jprojects\nexus\scripts\bug.groovy)
      at bug.main(C:\jprojects\nexus\scripts\bug.groovy)

      Attachments

        Activity

          People

            phkim Kim, Pilho
            sevenm Horia Muntean
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: