12 public static Foo operator - (Foo? f)
15 return new Foo (-f.Value.Value);
25 public Bar (int value)
30 public static Bar? operator - (Bar? b)
33 return new Bar (-b.Value.Value);
42 static Foo NegateFoo (Foo f)
47 static Foo NegateFooNullable (Foo? f)
52 static Bar? NegateBarNullable (Bar? b)
57 static Bar? NegateBar (Bar b)
64 if (NegateFooNullable (null).Value != 42)
67 if (NegateFoo (new Foo (2)).Value != -2)
70 if (NegateBarNullable (null) != null)
73 if (NegateBar (new Bar (2)).Value.Value != -2)
76 Console.WriteLine ("OK");