repo.or.cz
/
mono-project.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
update readme (#21797)
[mono-project.git]
/
mcs
/
tests
/
test-null-operator-13.cs
blob
497911332b5b11df18175b8f0c5a0231a50925d1
1
using
System
;
2
3
static class
Crash
4
{
5
static
X
GetFoo
()
6
{
7
return null
;
8
}
9
10
static int
Main
()
11
{
12
int
res
= (
GetFoo
()?.
ToLower
()).
ToUpper
();
13
if
(
res
!=
0
)
14
return
1
;
15
16
return
0
;
17
}
18
}
19
20
class
X
21
{
22
public
Y
ToLower
()
23
{
24
throw new
ApplicationException
(
"should not be called"
);
25
}
26
}
27
28
class
Y
29
{
30
}
31
32
static class
SS
33
{
34
public static int
ToUpper
(
this
Y y
)
35
{
36
if
(
y
!=
null
)
37
return
1
;
38
39
return
0
;
40
}
41
}