[metadata] Fix leaks when handling a few attributes (#16675)
[mono-project.git] / mcs / tests / gtest-587.cs
blob60484bdec39e3fe2f17aa1877cae1433d23803bc
1 using System;
3 struct S
5 public static implicit operator string (S s)
7 return "1";
10 public static implicit operator short? (S s)
12 return 1;
15 public static implicit operator E (S s)
17 return 0;
21 public enum E
25 class C
27 public static int Main ()
29 E? e = 0;
30 const E e1 = (E)44;
31 var res = e == e1;
32 if (res != false)
33 return 1;
35 res = e1 == e;
36 if (res != false)
37 return 2;
39 E e2 = 0;
40 S s;
41 var res2 = e2 & s;
42 if (res2 != 0)
43 return 3;
45 res2 = s & e2;
46 if (res2 != 0)
47 return 4;
49 return 0;