-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Labels
4 - In ReviewA fix for the issue is submitted for review.A fix for the issue is submitted for review.Area-CompilersFeature - Async StreamsAsync StreamsAsync StreamsTestTest failures in roslyn-CITest failures in roslyn-CI
Milestone
Description
Version Used: c8b5f30
roslyn/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncIteratorTests.cs
Lines 4747 to 4784 in c8b5f30
| public void TryFinally_YieldBreakInDisposeMode(int iterations, string expectedOutput) | |
| { | |
| string source = @" | |
| using static System.Console; | |
| public class C | |
| { | |
| public static async System.Collections.Generic.IAsyncEnumerable<int> M() | |
| { | |
| yield return 1; | |
| await System.Threading.Tasks.Task.CompletedTask; | |
| try | |
| { | |
| try | |
| { | |
| Write(""Break ""); | |
| yield break; | |
| } | |
| finally | |
| { | |
| Write(""Throw ""); | |
| throw null; | |
| } | |
| } | |
| catch | |
| { | |
| Write(""Caught ""); | |
| yield break; | |
| } | |
| finally | |
| { | |
| Write(""Finally ""); | |
| } | |
| } | |
| }"; | |
| var comp = CreateCompilationWithAsyncIterator(new[] { Run(iterations), source }, options: TestOptions.DebugExe); | |
| comp.VerifyDiagnostics(); | |
| CompileAndVerify(comp, expectedOutput: expectedOutput); | |
| } |
When this test is run on .NET with ILVerify, the following warning is produced:
[MoveNext]: Leave into try block. { Offset = 0x11a }
Copilot
Metadata
Metadata
Labels
4 - In ReviewA fix for the issue is submitted for review.A fix for the issue is submitted for review.Area-CompilersFeature - Async StreamsAsync StreamsAsync StreamsTestTest failures in roslyn-CITest failures in roslyn-CI