We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
abstract enum E : int { None = 0; } abstract enum E' : E { None = 0, // Error: Already defined One = 1 } sealed enum E'' : E { None = 2, // Error: Already defined One = 1, // Error: Already defined Two = 2 }
Inherting from a sealed enum
sealed enum
sealed enum F : E'' // Error: (E'') is sealed. Hence can not be inherited { ... }
Generic Constraints The CLR does allow constrained generics based on enums, just that it isn't (yet) expressible in C# or VB.
Foo <T : {enum, E} >( T e ) { }
Existing enum construct
enum
enum Foo { ... }
would be equivalent to
sealed enum Foo { ... }
Casts All casting between abstract enum and a inherited enum,or vis-versa, must be explicit.
abstract enum
The text was updated successfully, but these errors were encountered:
Seems mostly like a dupe of #9120
Sorry, something went wrong.
No branches or pull requests
abstract enums
Inherting from a
sealed enum
Generic Constraints
The CLR does allow constrained generics based on enums, just that it isn't (yet) expressible in C# or VB.
Existing
enum
constructwould be equivalent to
Casts
All casting between
abstract enum
and a inherited enum,or vis-versa, must be explicit.The text was updated successfully, but these errors were encountered: