-
Notifications
You must be signed in to change notification settings - Fork 439
Open
Description
It would be very useful to be able to specify a default value for an enum field.
In the example below, MyEnum has a default literal value of A.
The struct MyStruct has two fields: the first, a, has a custom default set explicitly to MyEnum::C, while the second, b, uses the enum’s default literal value MyEnum::A.
enum MyEnum {
@default_literal
A,
B,
C
};
struct MyStruct {
@default(MyEnum::C)
MyEnum a;
MyEnum b;
};Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels