[ilasm] Don't break arguments compatiblity
[mono-project.git] / mcs / tests / test-903.cs
blob7dedb674dafaa35d46aef4ffef41b6aa8c531353
1 using System;
3 struct S
7 class C
9 public static int ConversionCalled;
11 public static implicit operator S (C c)
13 ++ConversionCalled;
14 return new S ();
18 class Program
20 static C field;
22 static int Main ()
24 C c = new C ();
25 var x = c ?? new S ();
27 if (C.ConversionCalled != 1)
28 return 1;
30 c = null;
31 x = c ?? new S ();
32 if (C.ConversionCalled != 1)
33 return 2;
35 x = field ?? new S ();
36 if (C.ConversionCalled != 1)
37 return 3;
39 return 0;