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

MapWithDefault doesn't have correct equals functionality

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.2
    • 1.7.3, 1.8-beta-1
    • None
    • None

    Description

      In this example, the last line fails but shouldn't:

      def m = [:].withDefault {k -> k * 2}
      m[1] = 3
      assert m[1] == 3
      assert m[2] == 4
      assert [1:3, 2:4] == m
      assert m == [1:3, 2:4]
      

      Attachments

        Activity

          People

            paulk Paul King
            paulk Paul King
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: