codeowners update
[mono.git] / mcs / errors / cs0151-2.cs
1 // CS0151: A switch expression of type `Y' cannot be converted to an integral type, bool, char, string, enum or nullable type
2 // Line: 28
3
4 class Y {
5         byte b;
6         
7         public static implicit operator int (Y i)
8         {
9                 return i.b;
10         }
11
12         public static implicit operator byte (Y i)
13         {
14                 return i.b;
15         }
16
17         public Y (byte b)
18         {
19                 this.b = b;
20         }                       
21 }
22
23 class X {
24         static void Main ()
25         {
26                 Y y = new Y (1);
27
28                 switch (y){
29                 case 0:
30                         break;
31                 case 1:
32                         break;
33                 }
34
35                 int a = y;
36         }
37 }