mirror of https://github.com/icsharpcode/ILSpy.git
Browse Source
Remove [AsyncIteratorStateMachine] attribute and left-over ldc.i4 instructions.pull/1730/head
7 changed files with 61 additions and 4 deletions
@ -0,0 +1,37 @@ |
|||||||
|
using System.Collections.Generic; |
||||||
|
using System.Threading.Tasks; |
||||||
|
|
||||||
|
namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty |
||||||
|
{ |
||||||
|
public class AsyncStreams |
||||||
|
{ |
||||||
|
public static async IAsyncEnumerable<int> CountTo(int until) |
||||||
|
{ |
||||||
|
for (int i = 0; i < until; i++) { |
||||||
|
yield return i; |
||||||
|
await Task.Delay(10); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public static async IAsyncEnumerable<int> AlwaysThrow() |
||||||
|
{ |
||||||
|
throw null; |
||||||
|
yield break; |
||||||
|
} |
||||||
|
|
||||||
|
public static async IAsyncEnumerator<int> InfiniteLoop() |
||||||
|
{ |
||||||
|
while (true) { |
||||||
|
} |
||||||
|
yield break; |
||||||
|
} |
||||||
|
|
||||||
|
public static async IAsyncEnumerable<int> InfiniteLoopWithAwait() |
||||||
|
{ |
||||||
|
while (true) { |
||||||
|
await Task.Delay(10); |
||||||
|
} |
||||||
|
yield break; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue