Created
August 12, 2017 15:34
-
-
Save jskeet/b5f0acad8557416990942fa8f0bc7e5d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading.Tasks; | |
class Test | |
{ | |
static void Main() | |
{ | |
Foo().GetAwaiter().GetResult(); | |
} | |
static async Task Foo() | |
{ | |
var task = Task.FromResult((x: 10, y: 20)); | |
var tuple = await task; | |
Console.WriteLine(tuple.x); | |
Console.WriteLine(tuple.y); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment