We currently generate a public Discriminant property in the base record class for enum with fields.
I propose to remove this property, but keep the public Discriminant const in the known enumerators and the Discriminant property in the Unknown enumerator (for unchecked enum).
For "int" enum, the int value of the enumerator is naturally important. However, for enum with fields, it's just an encoding detail. While it's doable to expose this value in C# (as currently done), we probably can't do this as cleanly in other languages. These discriminants are also comparable to tag values, and we currently don't provide any way for a C# applications to retrieve these tag values.
We currently generate a public Discriminant property in the base record class for enum with fields.
I propose to remove this property, but keep the public Discriminant const in the known enumerators and the Discriminant property in the Unknown enumerator (for unchecked enum).
For "int" enum, the int value of the enumerator is naturally important. However, for enum with fields, it's just an encoding detail. While it's doable to expose this value in C# (as currently done), we probably can't do this as cleanly in other languages. These discriminants are also comparable to tag values, and we currently don't provide any way for a C# applications to retrieve these tag values.