groovy
  1. groovy
  2. GROOVY-921

use maps analagous to lists in implicit ctors on 'as' enforced coercion

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0-JSR-2
    • Fix Version/s: 1.0
    • Component/s: syntax
    • Labels:
      None
    • Testcase included:
      yes
    • Number of attachments :
      0

      Description

      lists allow implicit ctors on enforce type coercion with the 'as' keyword

      [100,200] as Dimension

      maps are used for named parameters in ctors like
      new Dimension(x:100, y:200)

      just as a matter of completeness it would be logical to also provide

      [x:100, y:200] as Dimension

      Test:
      assert new Dimension(x:100, y:200) == [x:100, y:200] as Dimension

        Activity

        Hide
        Paul King added a comment -

        Should work now in HEAD

        Show
        Paul King added a comment - Should work now in HEAD
        Hide
        Paul King added a comment -

        Dierk, let me know if you want me to back this out until 1.1. Just trying to pick off some easy to close Jira issues before 1.0. Jochen has also suggested a better way to do this so I can back out this code and put in the new code in later if you want.

        Show
        Paul King added a comment - Dierk, let me know if you want me to back this out until 1.1. Just trying to pick off some easy to close Jira issues before 1.0. Jochen has also suggested a better way to do this so I can back out this code and put in the new code in later if you want.
        Hide
        Dierk König added a comment -

        Hi Paul, I'm fine with putting it into 1.0. It does not invalidate anything in the book, it only makes it less complete.

        Show
        Dierk König added a comment - Hi Paul, I'm fine with putting it into 1.0. It does not invalidate anything in the book, it only makes it less complete.
        Hide
        Paul King added a comment -

        No further feedback, assuming fixed

        Show
        Paul King added a comment - No further feedback, assuming fixed

          People

          • Assignee:
            Paul King
            Reporter:
            Dierk König
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: