[mcs] Add codegen for null operator on result of awaited instance expression of prope...
[mono.git] / mcs / tests / test-223.cs
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 //
6
7 enum Foo { Bar }
8 class T {
9         public static int Main ()
10         {
11                 System.Enum e = Foo.Bar;
12                 System.ValueType vt1 = Foo.Bar, vt2 = 1;
13                 
14                 if (((Foo) e) != Foo.Bar)
15                         return 1;
16                 
17                 if (((Foo) vt1) != Foo.Bar)
18                         return 2;
19                 
20                 if (((int) vt2) != 1)
21                         return 3;
22
23                 //
24                 // Test that we can assign null to a valueType
25                 //
26
27                 System.ValueType vt = null;
28                 
29                 return 0;
30         }
31 }