linux-packaging-mono/mcs/tests/test-async-68.cs

22 lines
389 B
C#
Raw Permalink Normal View History

using System.Threading.Tasks;
class X
{
public async Task ReturnsTaskAsync (Task task)
{
await task;
}
public async Task<Task> ReturnsTaskOfTaskAsync ()
{
var t1 = Task.FromResult (ReturnsTaskAsync (null));
await t1;
Task<Task> t2 = Task.FromResult (ReturnsTaskAsync (null));
return t2;
}
public static void Main ()
{
new X ().ReturnsTaskOfTaskAsync ().Wait ();
}
}