spec-docs/enums.md
Goals:
Simple enum:
enum class Foo {
A
B
C {
override fun foo() { ... }
}
open fun foo() {}
}
Enum with constructor:
enum class Foo(val s: String) {
A("a")
B("b")
C("c") {
override fun foo() { ... }
}
open fun foo() {}
}
Issues
entry. downside: verbosityA("s"): OtherTypeExample for option 1.4:
enum class Foo(val s: String) {
A("a"), // semicolon CAN NOT be used here!
B("b"), // comma is MANDATORY after each enum constant except the last one
C("c") {
override fun foo() { ... }
}; // semicolon is MANDATORY here, even if no member follows
open fun foo() {}
}
Notes:
public (or any other soft-keyword used as a modifier), which is unfortunate