eol
[mcs.git] / tests / gtest-etree-04.cs
blob76bbfcc1a9d173652433f88b22e5182dd0c2b0cd
1 using System;
2 using System.Linq.Expressions;
4 struct Foo
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 ();
27 class C
29 static int Main()
31 Foo f;
32 Expression<Func<bool>> e = () => f > null;
33 if (e.Compile ().Invoke ())
34 return 1;
36 e = () => f < null;
37 if (e.Compile ().Invoke ())
38 return 2;
40 e = () => f == null;
41 if (e.Compile ().Invoke ())
42 return 3;
44 e = () => f != null;
45 if (!e.Compile ().Invoke ())
46 return 4;
48 Console.WriteLine ("OK");
49 return 0;