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
Take stars out of types where they make more sense.
[mono-project.git]
/
mcs
/
tests
/
gtest-optional-02.cs
blob
890b05c4b53ba3e27a2b0e3864460a1109b94e6a
1
using
System
;
2
3
public class
C
4
{
5
public static bool
Test3
(
int
?
i
=
new int
())
6
{
7
return
i
==
0
;
8
}
9
10
public static bool
Test2
(
int
?
i
=
null
)
11
{
12
return
i
==
null
;
13
}
14
15
public static int
Test
(
int
?
i
=
1
)
16
{
17
return
i
??
9
;
18
}
19
20
public static long
Test4
(
long
?
i
=
5
)
21
{
22
return
i
.
Value
;
23
}
24
25
public static int
Main
()
26
{
27
if
(
Test
() !=
1
)
28
return
1
;
29
30
if
(
Test
(
null
) !=
9
)
31
return
2
;
32
33
if
(!
Test2
())
34
return
3
;
35
36
if
(
Test2
(
3
))
37
return
4
;
38
39
if
(!
Test3
())
40
return
5
;
41
42
if
(
Test4
() !=
5
)
43
return
6
;
44
45
return
0
;
46
}
47
}
48