proposal : let enums acting like vb.net acts #3617
Replies: 4 comments
-
This has already been thoroughly discussed elsewhere - in C# doing bit shifts on the values of enumerations is only allowed during definition, as a convenience. Bit shifting on values outside the definition is prohibited because it's a fruitful source of bugs. Please don't open duplicate issues just because you don't like the outcome of the conversation. |
Beta Was this translation helpful? Give feedback.
-
They told me I can push proposal, so it's not duplicate, this is proposal, title are different and this focused to "enums" and not others. |
Beta Was this translation helpful? Give feedback.
-
Documents: The set of values that an enum type can take on is not limited by its enum members. Enum values and operations Valid Example: class Program
{
public enum a {a1=1}
public static void Main()
{
// no error
a a = a.a1 + 1000;
}
} |
Beta Was this translation helpful? Give feedback.
-
The proposal is fine to have. But please stop closing proposals that are effectively duplicates just to open the same ones again. Thanks :) I'll leave this open as i think it's totally fine to request this as a language change. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
sample valid code in vb.net:
more details can be found here : #3572 , #3593
Beta Was this translation helpful? Give feedback.
All reactions