2009-12-12 Rodrigo Kumpera <rkumpera@novell.com>
[mcs.git] / tests / test-322.cs
blob47b4aebddc6d1af971138a22a40847cea369d6aa
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.
8 class Y {
9 byte b;
11 public static implicit operator int (Y i)
13 return i.b;
16 public Y (byte b)
18 this.b = b;
22 class X {
23 static void Main ()
25 Y y = new Y (1);
27 switch (y){
28 case 0:
29 break;
30 case 1:
31 break;
34 int a = y;