Merge pull request #4935 from lambdageek/dev-handles-may
[mono.git] / mcs / tests / test-322.cs
1 //
2 // User casts basically would produce more than one match on 
3 // integral types, since the implicit conversion to int is
4 // also an implicit conversion to long.   This tests that
5 // we do not bail too early on the switch statement with its
6 // implicit conversion.  
7
8 class Y {
9         byte b;
10         
11         public static implicit operator int (Y i)
12         {
13                 return i.b;
14         }
15
16         public Y (byte b)
17         {
18                 this.b = b;
19         }                       
20 }
21
22 class X {
23         public static void Main ()
24         {
25                 Y y = new Y (1);
26
27                 switch (y){
28                 case 0:
29                         break;
30                 case 1:
31                         break;
32                 }
33
34                 int a = y;
35         }
36 }