Merge pull request #1861 from saper/home-override
[mono-project.git] / mcs / tests / test-223.cs
blob822dc5c762fed269b3804222654e1d0c1371e4e9
1 //
2 // This tests that conversions from Enum and ValueType to structs
3 // are treated as unboxing conversions, and the `unbox' opcode
4 // is emitted. #52569.
5 //
7 enum Foo { Bar }
8 class T {
9 public static int Main ()
11 System.Enum e = Foo.Bar;
12 System.ValueType vt1 = Foo.Bar, vt2 = 1;
14 if (((Foo) e) != Foo.Bar)
15 return 1;
17 if (((Foo) vt1) != Foo.Bar)
18 return 2;
20 if (((int) vt2) != 1)
21 return 3;
24 // Test that we can assign null to a valueType
27 System.ValueType vt = null;
29 return 0;