summaryrefslogtreecommitdiff
path: root/mcs/tests/dtest-named-02.cs
blob: 2ec4651bb17938644106e06dc17454d24e5cad3e (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
48
49
50
using System;

public class Test
{
	static int counter;

	static int M1 ()
	{
		if (counter != 2)
			throw new ApplicationException ();

		return counter++;
	}

	static int M2 ()
	{
		if (counter != 3)
			throw new ApplicationException ();

		return counter++;
	}

	static dynamic M3 ()
	{
		if (counter != 1)
			throw new ApplicationException ();

		return counter++;
	}

	static int Foo (int a, int b, int c)
	{
		if (a != 2)
			return 1;

		if (b != 3)
			return 2;

		if (c != 1)
			return 3;

		return 0;
	}

	public static int Main ()
	{
		counter = 1;
		return Foo (c: M3 (), a: M1 (), b: M2 ());
	}
}