projects
/
mono.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Allow passing null to JsonArray.Add()
[mono.git]
/
mcs
/
tests
/
gtest-lambda-37.cs
1
using System;
2
3
public class MainClass
4
{
5
static long? X<T> (T a1, Func<T, T?> a2) where T : struct
6
{
7
return 0;
8
}
9
10
static int? X<T> (T a1, Func<T, int?> a2)
11
{
12
return 0;
13
}
14
15
static double? X<T> (T a1, Func<T, double?> a2)
16
{
17
return null;
18
}
19
20
public static void Main ()
21
{
22
int? sum = X<int> (1, i => {
23
if (i > 0)
24
return i;
25
26
return null;
27
});
28
29
30
int? sum2 = X (1, i => {
31
if (i > 0)
32
return i;
33
34
return null;
35
});
36
37
}
38
}