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

test-async-67.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2348dc7ff7d5dae892e7afc06b74701ba8178821 (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
using System;
using System.Threading.Tasks;

class Test
{
	public static async Task<int[]> Run ()
	{
		return new int[] {
			1, await Task.Factory.StartNew (() => 2)
		};
	}

	public static int Main ()
	{
		var t = Run ().Result;
		if (t [0] != 1)
			return 1;

		if (t [1] != 2)
			return 2;

		return 0;
	}
}