linux-packaging-mono/mcs/tests/test-anon-118.cs
Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

29 lines
539 B
C#

// Supported by C# 3.0
public class C
{
public delegate TR Func<TR, TA> (TA t);
public static TR Test<TR, TA> (Func<TR, TA> f)
{
return default (TR);
}
public static TR Test<TR, TA, TB> (Func<TR, TA> f, Func<TR, TB> f2)
{
return default (TR);
}
public static void Test2<T> ()
{
T r = Test (delegate (T i) { return i; });
}
public static void Main()
{
int r = Test (delegate (int i) { return i < 1 ? 'a' : i; });
string s = Test (delegate (int i) { return "a"; }, delegate (int i) { return "b"; });
}
}