dlr bug
[mcs.git] / tests / gtest-428.cs
blob33e76fcd022902e25ff5dc0d4b431de58349ada7
1 using System;
3 public struct CInt
5 int data;
7 public CInt (int data)
9 this.data = data;
12 public static implicit operator CInt (int xx)
14 return new CInt (xx);
17 public static implicit operator int (CInt xx)
19 return xx.data;
24 public class Klass
26 CInt? t;
27 public Klass (CInt? t)
29 this.t = t;
32 public CInt? Value
34 get
36 return t;
41 public class MainClass
43 public static int Main ()
45 var v = new Klass (new CInt (3));
47 if (v.Value == 1)
48 return 1;
50 if (v.Value != 3)
51 return 2;
53 if (v.Value == null)
54 return 3;
56 var v2 = new Klass (null);
58 if (v2.Value != null)
59 return 4;
61 Console.WriteLine ("OK");
62 return 0;