blob: 822dc5c762fed269b3804222654e1d0c1371e4e9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
//
// This tests that conversions from Enum and ValueType to structs
// are treated as unboxing conversions, and the `unbox' opcode
// is emitted. #52569.
//
enum Foo { Bar }
class T {
public static int Main ()
{
System.Enum e = Foo.Bar;
System.ValueType vt1 = Foo.Bar, vt2 = 1;
if (((Foo) e) != Foo.Bar)
return 1;
if (((Foo) vt1) != Foo.Bar)
return 2;
if (((int) vt2) != 1)
return 3;
//
// Test that we can assign null to a valueType
//
System.ValueType vt = null;
return 0;
}
}
|