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

Allow default parameters on constructors

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.0-RC-1
    • None
    • None
    • mac os x 10.3.3, java 1.4.2

    Description

      I have discovered that default parameters on ctors are not supported. I would like to request that this feature be supported. Here is a code snippet that can show it works/does not work:

      class Bug6 {
      a

      Bug6(aa = 23)

      { a = aa }

      static void main(args)

      { b = new Bug6() if(b.address != 23) println "default args don't work on constructors!" }

      }

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            johnstump John Stump
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: