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

Describe named arguments constructor option for enum

    XMLWordPrintableJSON

Details

    • Documentation
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      Groovy enum includes no-arg and named-args constructors if no explicit constuctors are declared. Add description to language docs for named arguments constructor.

      enum Foo {
        BAR(number:42, string:'x')
        final Number number
        public String string
      }
      print Foo.BAR.number // prints: 42
      print Foo.BAR.string // prints: null
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            emilles Eric Milles
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: