Guest User

Untitled

a guest
Jan 13th, 2014
1,019
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.54 KB | None | 0 0
  1. using System.Runtime.CompilerServices;
  2.  
  3. namespace ConsoleApplication59
  4. {
  5.     class Program
  6.     {
  7.         private static void Main()
  8.         {
  9.             MainAsync();
  10.         }
  11.  
  12.         private async static void MainAsync()
  13.         {
  14.             await Foo();
  15.         }
  16.  
  17.         static TA Foo()
  18.         {
  19.             return new TA();
  20.         }
  21.     }
  22.  
  23.     class TA { }
  24.  
  25.     static class TAEx
  26.     {
  27.         public static TaskAwaiter GetAwaiter(this TA ta)
  28.         {
  29.             return new TaskAwaiter();
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment