//other variables public void MoveNext() { // Jump table to get back to the right statement upon resumption switch (this._state) { case 1: goto Label1; } var t = new TestAwaiter(true); this._awaiter = t.GetAwaiter(); if (!this._awaiter.IsCompleted) { this._state = 1; this._awaiter.OnCompleted(MoveNext); return; } Label1: string result = this._awaiter.GetResult(); var stack = new StackTrace(); Console.WriteLine(stack); }
private static async Task WaitAwaiter(bool isCompleted) { var t = new TestAwaiter(isCompleted); string res = await t; var stack = new StackTrace(); Console.WriteLine(stack); }