projects
/
mono.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
[msbuild] bump to xplat-master branch HEAD
[mono.git]
/
mcs
/
tests
/
test-null-operator-14.cs
1
using System;
2
3
class Test
4
{
5
static void Main ()
6
{
7
Test_1 ("");
8
Test_1<object> (null);
9
10
Test_2<object> (null);
11
Test_2 ("z");
12
Test_2 (0);
13
Test_2 ((long?) -8);
14
15
Test_3 (new int[1]);
16
Test_3 (new int[] { 5 });
17
}
18
19
static void Test_1<T> (T x) where T : class
20
{
21
x?.Call ();
22
}
23
24
static void Test_2<T> (T x)
25
{
26
x?.Call ();
27
}
28
29
static void Test_3<T> (T[] x)
30
{
31
x[0]?.Call ();
32
}
33
}
34
35
static class Ext
36
{
37
public static void Call<T> (this T t)
38
{
39
Console.WriteLine (typeof (T));
40
}
41
}