linux-packaging-mono/mcs/tests/gtest-lambda-37.cs
Xamarin Public Jenkins (auto-signing) e79aa3c0ed Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
2016-08-03 10:59:49 +00:00

39 lines
451 B
C#

using System;
public class MainClass
{
static long? X<T> (T a1, Func<T, T?> a2) where T : struct
{
return 0;
}
static int? X<T> (T a1, Func<T, int?> a2)
{
return 0;
}
static double? X<T> (T a1, Func<T, double?> a2)
{
return null;
}
public static void Main ()
{
int? sum = X<int> (1, i => {
if (i > 0)
return i;
return null;
});
int? sum2 = X (1, i => {
if (i > 0)
return i;
return null;
});
}
}