3 public class ConvFromInt
{
5 public ConvFromInt () { val = 0; }
6 public ConvFromInt (int value) { val = value + 1; }
7 public static implicit operator ConvFromInt (int value) { return new ConvFromInt (value); }
12 public static ConvFromInt i
= 0;
13 public static object BoolObj
= (bool) false;
14 public static object ByteObj
= (byte) 0;
15 public static ValueType BoolVal
= (bool) false;
17 public static void Main ()
19 if (i
== null) throw new Exception ("i");
20 if (i
.val
== 0) throw new Exception ("i.val");
21 if (BoolObj
== null) throw new Exception ("BoolObj");
22 if (ByteObj
== null) throw new Exception ("ByteObj");
23 if (BoolVal
== null) throw new Exception ("BoolVal");