2 using System.Linq.Expressions;
6 public static bool operator > (Foo d1, Foo d2)
8 throw new ApplicationException ();
11 public static bool operator < (Foo d1, Foo d2)
13 throw new ApplicationException ();
16 public static bool operator == (Foo d1, Foo d2)
18 throw new ApplicationException ();
21 public static bool operator != (Foo d1, Foo d2)
23 throw new ApplicationException ();
26 public static Foo operator + (Foo d1, Foo d2)
28 throw new ApplicationException ();
34 public static int Main()
37 Expression<Func<bool>> e = () => f > null;
38 if (e.Compile ().Invoke ())
42 if (e.Compile ().Invoke ())
46 if (e.Compile ().Invoke ())
50 if (!e.Compile ().Invoke ())
53 Expression<Func<Foo?>> e2 = () => f + null;
54 if (e2.Compile ().Invoke () != null)
57 Console.WriteLine ("OK");