Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gtest-anon-18.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7b6a1afe6af4f00b47d98b175b82f2ec03bcda0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

// 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"; });
	}
}