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

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

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0-JSR-2
    • Fix Version/s: 1.0
    • Component/s: syntax
    • Labels:
      None

      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

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: