[System.Windows.Forms] Disable failing test
[mono-project.git] / mcs / tests / test-pattern-07.cs
blobbc7dfda0a89bdbb0566ec87348ce2107546519e1
1 // Compiler options: -langversion:experimental
3 using System;
5 class PropertyPattern
7 static int Main ()
9 object o = new DateTime (2014, 8, 30);
11 if (!(o is DateTime { Day is 30 }))
12 return 1;
14 if (!(o is DateTime { Month is 8, Day is 30, Year is * }))
15 return 2;
17 if (o is X { Field is 30 })
18 return 3;
20 object o2 = new X () {
21 Field = new Y () {
22 Prop = 'f'
26 bool res2 = o2 is X { Field is Y { Prop is 'f' }, Field is Y (4) };
27 if (!res2)
28 return 4;
30 res2 = o2 is X { Field is Y { Prop is 'g' } };
31 if (res2)
32 return 5;
34 object o3 = new X () {
35 Value = 5
38 if (o3 is X { Value is 6 })
39 return 6;
41 if (!(o3 is X { Value is 5 }))
42 return 7;
44 object o4 = new X () {
45 NullableValue = 4
48 bool res3 = o4 is X { NullableValue is (byte) 4 };
49 if (!res3)
50 return 8;
52 Console.WriteLine("ok");
53 return 0;
57 class X
59 public object Field { get; set; }
61 public object Value { get; set; }
63 public long? NullableValue { get; set; }
66 class Y
68 public char Prop { get; set; }
70 public static bool operator is (Y y, out int x)
72 x = 4;
73 return true;