{
public static bool operator == (Foo d1, Foo d2)
{
- return false;
+ throw new ApplicationException ();
}
public static bool operator != (Foo d1, Foo d2)
{
- return true;
+ throw new ApplicationException ();
}
}
+struct S2
+{
+ public static bool operator == (S2 d1, S2? d2)
+ {
+ throw new ApplicationException ();
+ }
+
+ public static bool operator != (S2 d1, S2? d2)
+ {
+ throw new ApplicationException ();
+ }
+}
+
+public struct S3
+{
+ public static decimal operator != (S3 a, object b)
+ {
+ return -1;
+ }
+
+ public static decimal operator == (S3 a, object b)
+ {
+ return 1;
+ }
+}
+
+
public class Test
{
static Foo ctx;
+ static S2? s2;
+ static S3? s3;
- public static void Main ()
+ public static int Main ()
{
if (ctx == null)
- return;
+ return 1;
+
+ bool b = ctx != null;
+ if (!b)
+ return 2;
+
+ if (s2 != null)
+ return 3;
+
+ s3 = new S3 ();
+ decimal d = s3.Value == null;
+ if (d != 1)
+ return 4;
- if (ctx != null)
- return;
+ Console.WriteLine ("ok");
+ return 0;
}
}