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

Cast short-hand breaks for empty map

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0-alpha-3
    • Fix Version/s: 3.0.0-alpha-4
    • Component/s: None
    • Labels:

      Description

      We support:

      println Date[time:0]
      def map = [time:0]
      println Date[*:map]
      map = [:]
      println Date[*:map]
      

      but not:

      println Date[:]
      

      This is a breaking change since we currently support printing an empty map without brackets but would require them after this change:

      println [:]
      

      would need to be:

      println([:])
      

      But we require the brackets for lists (empty and non-empty) and non-empty maps already.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                paulk Paul King
                Reporter:
                paulk Paul King
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: