[ https://issues.apache.org/jira/browse/GROOVY-10811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17904608#comment-17904608 ]
Eric Milles edited comment on GROOVY-10811 at 12/10/24 10:39 PM: ----------------------------------------------------------------- https://github.com/apache/groovy/commit/9278d262a07624a095ec5ace875e981656f0cb9d https://github.com/apache/groovy/commit/634ce6b09da431b0c2df6ff6fa6aad486a6cae43 https://github.com/apache/groovy/commit/2e3f300fb19bf87c2e41c6c5e356db2f8b328e70 was (Author: emilles): https://github.com/apache/groovy/commit/9278d262a07624a095ec5ace875e981656f0cb9d https://github.com/apache/groovy/commit/634ce6b09da431b0c2df6ff6fa6aad486a6cae43 > 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 > Assignee: Eric Milles > Priority: Minor > Labels: breaking, 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 an enum 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)