2010-06-21 Atsushi Enomoto <atsushi@ximian.com>
[mcs.git] / errors / cs0151-2.cs
blobd2b8028c978a819fcca8d65a32d4d1ccd02f5184
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
4 class Y {
5 byte b;
7 public static implicit operator int (Y i)
9 return i.b;
12 public static implicit operator byte (Y i)
14 return i.b;
17 public Y (byte b)
19 this.b = b;
23 class X {
24 static void Main ()
26 Y y = new Y (1);
28 switch (y){
29 case 0:
30 break;
31 case 1:
32 break;
35 int a = y;