summaryrefslogtreecommitdiff
path: root/mcs/tests/test-async-52.cs
blob: 36230acd7761050253b266c90c0ff424cd46e46b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using System;
using System.Threading.Tasks;

public delegate T ActualValueDelegate<T> ();

class X
{
	public static void Main ()
	{
		Matches (async () => await Throw());
	}

	static bool Matches<T>(ActualValueDelegate<T> del) where T : Task
	{
		del ().Wait ();
		return true;
	}

	static async Task Throw()
	{
		await Task.Delay (1);
	}
}