Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

26 lines
738 B
C#

using System;
public class ConvFromInt {
public int val;
public ConvFromInt () { val = 0; }
public ConvFromInt (int value) { val = value + 1; }
public static implicit operator ConvFromInt (int value) { return new ConvFromInt (value); }
}
public class Foo
{
public static ConvFromInt i = 0;
public static object BoolObj = (bool) false;
public static object ByteObj = (byte) 0;
public static ValueType BoolVal = (bool) false;
public static void Main ()
{
if (i == null) throw new Exception ("i");
if (i.val == 0) throw new Exception ("i.val");
if (BoolObj == null) throw new Exception ("BoolObj");
if (ByteObj == null) throw new Exception ("ByteObj");
if (BoolVal == null) throw new Exception ("BoolVal");
}
}