ccf5fc47dd45b36c032a8d660a11aa409cc46da6
[mono.git] / mcs / tests / test-99.cs
1 using System;
2 class X {
3         enum A : int {
4                 a = 1, b, c
5         }
6         
7         enum Test : short {
8                 A = 1,
9                 B
10         }
11         
12         static int Main ()
13         {
14                 int v = 1;
15                 object foo = (v + A.a);
16                 object foo2 = (1 + A.a);
17
18                 if (foo.GetType ().ToString () != "X+A"){
19                         Console.WriteLine ("Expression evaluator bug in E operator + (U x, E y)");
20                         return 1;
21                 }
22                 
23                 if (foo2.GetType ().ToString () != "X+A"){
24                         Console.WriteLine ("Constant folder bug in E operator + (U x, E y)");
25                         return 2;
26                 }
27
28                 // Now try the implicit conversions for underlying types in enum operators
29                 byte b = 1;
30                 short s = (short) (Test.A + b);
31                 
32                 return 0;
33         }
34 }