projects
/
mono.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
[System.Net.Http] HttpClient timeout range checks. Fixes #25755
[mono.git]
/
mcs
/
tests
/
test-pattern-01.cs
1
using System;
2
3
class TypePattern
4
{
5
public static int Main ()
6
{
7
object o = 3;
8
bool r = o is System.String t1;
9
if (r)
10
return 2;
11
12
if (o is string t2)
13
return 3;
14
15
long? l = 5;
16
bool r3 = l is long t4;
17
18
if (!r3)
19
return 8;
20
21
Console.WriteLine ("ok");
22
return 0;
23
}
24
25
static void Test1 (object arg)
26
{
27
while (arg is int b) {
28
b = 2;
29
}
30
}
31
32
static string Test2 (object arg)
33
{
34
if (arg is string s) {
35
return s;
36
} else {
37
s = "";
38
}
39
40
return s;
41
}
42
}