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

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0-JSR-2
    • 1.0
    • syntax
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: