Added time format with only offset. Fixes #22558.
[mono.git] / mcs / tests / test-pattern-01.cs
1 // Compiler options: -langversion:experimental
2
3 using System;
4
5 class TypePattern
6 {
7         public static int Main ()
8         {
9                 object o = 3;
10                 bool r = o is string t1;
11                 if (t1 != null)
12                         return 1;
13
14                 if (r)
15                         return 2;
16
17                 if (o is string t2)
18                         return 3;
19
20                 if (t2 != null)
21                         return 4;
22
23                 object o2 = (int?) 4;
24                 bool r2 = o2 is byte? t3;
25
26                 if (t3 != null)
27                         return 5;
28
29                 if (r2)
30                         return 6;
31
32                 long? l = 5;
33                 bool r3 = l is long t4;
34                 if (t4 != 5)
35                         return 7;
36
37                 if (!r3)
38                         return 8;
39
40                 Console.WriteLine ("ok");
41                 return 0;
42         }
43 }