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

gtest-505.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0150d110e55dbddd28dfa998e5f4cea539fe7e9c (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
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Collections.Generic;

class C
{
	static int Test (List<int> arg)
	{
		return 10;
	}

	static int Test (string arg)
	{
		return 9;
	}

	static int Test (int arg)
	{
		return 8;
	}

	static R Method<T, R> (IEnumerable<T> t, Func<T, R> a)
	{
		return a (default (T));
	}

	static R Method2<T, R> (IEnumerable<T> t, Func<List<T>, R> a)
	{
		return a (default (List<T>));
	}

	public static int Main ()
	{
		if (Method (new int[] { 1 }, Test) != 8)
			return 1;

		if (Method2 (new int[] { 1 }, Test) != 10)
			return 2;

		return 0;
	}
}