[ilasm] Don't break arguments compatiblity
[mono-project.git] / mcs / tests / test-119.cs
blob29d5e008c0f0baf996e232b9f0607bfd302036e2
1 class Value {
2 public static explicit operator int (Value val)
4 return 1;
7 public static explicit operator MyObject (Value val)
9 return new MyObject (1);
12 public static explicit operator uint (Value val)
14 return 1;
18 class MyObject {
19 public MyObject (int i) {}
22 class Derived : MyObject {
23 public Derived (int i) : base (i) { }
25 Derived Blah ()
27 Value val = new Value ();
29 return (Derived) val;
33 class Test {
34 public static int Main ()
36 Value v = new Value ();
38 v = null;
40 try {
41 // This will throw an exception.
42 // This test is more of a compile test, we need a real
43 // good test that does not require this lame catch.
44 Derived d = (Derived) v;
45 } catch {
48 return 0;