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

22 lines
291 B
C#
Raw Permalink Normal View History

using System;
using System.Threading.Tasks;
class MainClass
{
public static void Main ()
{
new MainClass ().Foo ().Wait ();
}
private async Task<int> Foo()
{
await Task.Delay(1);
return 42;
}
private async Task Bar()
{
Console.WriteLine($"Something {await Foo()}");
}
}