On 30 December 2020 08:43:33 GMT+00:00, Markus Fischer <markus@fischer.name> wrote:
What is the scalar value for a ScalarEnum if none is explicitly
defined?
The question has no answer, because the declaration of the enum itself would be invalid:
If an enumeration is marked as having a scalar equivalent, then all cases must have a unique scalar equivalent defined explicitly.
enum Suit: string {
case Hearts;
case Diamonds;
}
Presumably, this would result in an Error being thrown when compiling the declaration.
I see.
What's the quickest way (=less code) to have an enum represent it's lexical name as the literal values?
So that