> >> I kind a like the intellectual separation between >> - a sealed interface which represent a closed type and requires a permit >> clause and >> - an enum interface which represent a sum type which is sugar on top of >> sealed interface + records. >
To be clear, I think what Alan is suggesting, and what Remi is supporting, is: - Make “sealed” the primitive for defining closed types, as originally proposed, and also - Make the following enumerated interface Foo { R(X), S(Y); STUFF } sugar for sealed interface Foo permits R, S { STUFF record R(X) implements Foo { } record S(Y) implements Foo { } } Is that correct?