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

dtest-027.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9a97972897ac584efcfb398fcd6388f690884b40 (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
42
43
44
45
46
47
class C
{
	public int M (object d, long s)
	{
		return 1;
	}
	
	public int M (long s, object d)
	{
		return 2;
	}

	public int M (dynamic d, dynamic s)
	{
		return 3;
	}
	
	public int M2 (object d)
	{
		return 1;
	}
	
	public int M2 (byte s)
	{
		return 2;
	}
}

public class Test
{
	public static int Main ()
	{
		dynamic d = new C ();
		byte s = 5;
		object o = 2;
		int v = d.M (s, o);
		
		if (v != 2)
			return 1;
		
		v = d.M2 (1 + 3);
		if (v != 2)
			return 2;

		return 0;
	}
}