[ https://issues.apache.org/jira/browse/GROOVY-10811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles updated GROOVY-10811: --------------------------------- Description: Consider the following: {code:groovy} final enum E { FOO; E(int i) { super() } } {code} * Explicit {{abstract}} or {{final}} modifier is supposed to be an error because the type is made abstract or final depending on what's declared: "It is a compile-time error if an enum declaration has the modifier abstract or final." https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-8.9 * 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)." was: Consider the following: {code:groovy} final enum E { FOO; E(int i) { super() } } {code} * Explicit {{abstract}} or {{final}} modifier is supposed to be an error : "It is a compile-time error if an enum declaration has the modifier abstract or final." https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-8.9 * 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)." > Missing errors for improper enum declaration > -------------------------------------------- > > Key: GROOVY-10811 > URL: https://issues.apache.org/jira/browse/GROOVY-10811 > Project: Groovy > Issue Type: Bug > Reporter: Eric Milles > Priority: Major > Labels: enum > > Consider the following: > {code:groovy} > final enum E { > FOO; > E(int i) { > super() > } > } > {code} > * Explicit {{abstract}} or {{final}} modifier is supposed to be an error > because the type is made abstract or final depending on what's declared: "It > is a compile-time error if an enum declaration has the modifier abstract or > final." https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-8.9 > * 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)." -- This message was sent by Atlassian Jira (v8.20.10#820010)