projects
/
mono.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
[runtime] Don't insta-fail when a faulty COM type is encountered. (#5616)
[mono.git]
/
mcs
/
tests
/
gtest-optional-02.cs
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