1 // Compiler options: -langversion:experimental
9 object o
= new DateTime (2014, 8, 30);
11 if (!(o
is DateTime { Day is 30 }
))
14 if (!(o
is DateTime { Month is 8, Day is 30, Year is * }
))
17 if (o
is X { Field is 30 }
)
20 object o2
= new X () {
26 bool res2
= o2
is X { Field is Y { Prop is 'f' }
, Field
is Y (4) };
30 res2
= o2
is X { Field is Y { Prop is 'g' }
};
34 object o3
= new X () {
38 if (o3
is X { Value is 6 }
)
41 if (!(o3
is X { Value is 5 }
))
44 object o4
= new X () {
48 bool res3
= o4
is X { NullableValue is (byte) 4 }
;
52 Console
.WriteLine("ok");
59 public object Field { get; set; }
61 public object Value { get; set; }
63 public long? NullableValue { get; set; }
68 public char Prop { get; set; }
70 public static bool operator is (Y y
, out int x
)