Merge pull request #1861 from saper/home-override
[mono-project.git] / mcs / tests / gtest-585.cs
blobff2a16ca8cafa5acf1741b45c8faf82e6fa99a03
1 using System;
3 struct S
5 public static implicit operator int (S arg)
7 throw new ApplicationException ();
11 struct S2
13 public static implicit operator int?(S2 arg)
15 return 10000;
18 public static implicit operator uint?(S2 arg)
20 throw new ApplicationException ();
24 public struct S3
26 public static int counter;
28 public static implicit operator string (S3 s3)
30 counter++;
31 return "";
35 class C
37 public static int Main ()
39 S? s = null;
40 bool res = s > 1;
41 if (res)
42 return 1;
44 S2 s2 = new S2 ();
46 var b = s2 >> 3;
47 if (b != 1250)
48 return 2;
50 var b2 = s2 >> s2;
51 if (b2 != 0)
52 return 3;
54 var b3 = s2 + 1;
55 if (b3 != 10001)
56 return 4;
58 var s3 = new S3 ();
59 if ((s3 == null) != false)
60 return 5;
62 if ((s3 != null) != true)
63 return 6;
65 if (S3.counter != 2)
66 return 7;
68 Console.WriteLine ("ok");
69 return 0;