Crell / enum-comparison

A comparison of enumerations and similar features in different languages
80 stars 7 forks source link

Constant expressions for primitive values? #56

Closed iluuu1994 closed 3 years ago

iluuu1994 commented 3 years ago

Do we need:

enum Foo: int {
    case A = CONST_A;
    case B = CONST_B;
}

@bwoebi FYI

Crell commented 3 years ago

I'd consider this a nice-to-have, but not a show stopper. I don't know how practical or common it would be in practice.

iluuu1994 commented 3 years ago

Ok, can you specify in the RFC that this is currently not possible? Then we'll see if somebody objects :slightly_smiling_face:

Crell commented 3 years ago

Updated.