Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class C {
- enum Color {
- red,
- blue,
- noColor // This will be deprecated.
- }
- public void M1() {
- var castValue = ((int)Color.blue + (int)Color.blue);
- PrintColor((Color)castValue); // Do you want to allert this usage?
- }
- public void M2(int value) {
- PrintColor((Color)value); // Do you want to allert this usage when value is `2`?
- }
- void PrintColor(Color color)
- {
- Console.WriteLine(color);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement