10 e
= myconstant
| 0x1fff
13 public enum MyEnum
: byte {
26 enum AA
: byte { a, b }
27 enum BB
: ulong { x = ulong.MaxValue - 1, y }
29 const int myconstant
= 30;
31 enum Compute
: ulong {
38 internal enum WindowAttributes
: uint {
39 kWindowNoAttributes
= 0,
40 kWindowCloseBoxAttribute
= (1u << 0),
41 kWindowHorizontalZoomAttribute
= (1u << 1),
42 kWindowVerticalZoomAttribute
= (1u << 2),
43 kWindowCollapseBoxAttribute
= (1u << 3),
44 kWindowNoConstrainAttribute
= (1u << 31),
45 kWindowStandardFloatingAttributes
= (kWindowCloseBoxAttribute
| kWindowCollapseBoxAttribute
)
48 // The constant assignment follows a different path
49 const Bar bar_assignment
= 0;
51 public static int Main ()
53 byte b
= (byte) MyEnum
.Foo
;
55 Console
.WriteLine ("Foo has a value of " + b
);
63 int l
= (int) AA
.b
+ 1;
65 if ((int) Compute
.two
!= 2)
96 if (e
.ToString () != "d")
100 // Test "U operator (E x, E x)"
102 // Notice that the Microsoft C# compiler wont compile the following
103 // code, that is a bug in their compiler, see section 14.7.5 of the
106 if ((A
.c
- A
.a
) != 2)
109 if ((A
.c
- 1) != A
.b
)
112 Console
.WriteLine ("Value: " + e
.ToString ());
113 Console
.WriteLine ("Enum emission test okay");