projects
/
mono.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Merge pull request #2174 from stukselbax/master
[mono.git]
/
mcs
/
tests
/
test-null-operator-03.cs
1
using System;
2
3
class C
4
{
5
int field;
6
7
int Test1 ()
8
{
9
var x = this?.field;
10
if (x == null)
11
return 1;
12
13
var x2 = "abc"?.GetHashCode();
14
if (x2 == null)
15
return 2;
16
17
return 0;
18
}
19
20
static int Main ()
21
{
22
var c = new C ();
23
c.Test1 ();
24
25
const C c2 = null;
26
var res = c2?.field;
27
if (res != null)
28
return 1;
29
30
Console.WriteLine ("ok");
31
return 0;
32
}
33
}