Created
February 13, 2022 07:27
-
-
Save ihordyrman/0b897e9e49a946ec62a94b4dcc0dcd2b to your computer and use it in GitHub Desktop.
Revisions
-
ihordyrman created this gist
Feb 13, 2022 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ using System; using System.Runtime.CompilerServices; using System.Threading.Tasks; public class Program { public static async Task Main() { Console.WriteLine(await 1); } } public static class IntTaskExtensions { public static IntAwaiter GetAwaiter(this int number) => new IntAwaiter(number); public class IntAwaiter : INotifyCompletion { private int result; public IntAwaiter(int number) { result = number + 1; } public bool IsCompleted => true; public void OnCompleted(Action continuation) { } public int GetResult() { return result; } } }