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

Missing errors for improper enum declaration

    XMLWordPrintableJSON

Details

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

    Description

      Consider the following:

      final enum E {
        FOO;
        E(int i) {
          super()
        }
      }
      
      • The enum constant declaration "FOO" does not supply an argument, which results in a runtime error.
      • The special constructor call "super()" is not allowed by Java and results in a runtime error in Groovy. "It is a compile-time error if a constructor declaration in an enum declaration contains a superclass constructor invocation statement (ยง8.8.7.1)."

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated: