Skip to content

Test Plan for Runtime Async #75960

@333fred

Description

@333fred

Test plan for runtime-generated async state machines

Runtime open issues: dotnet/runtime#109632
Runtime specification: https://github.com/dotnet/runtime/blob/main/docs/design/specs/runtime-async.md
Compiler implementation plan: https://github.com/dotnet/roslyn/blob/main/docs/compilers/CSharp/Runtime%20Async%20Design.md

Included in .NET 10 (feature in preview)

  • turning feature on (see IsRuntimeAsyncEnabledIn)
    • presence of required AsyncHelpers APIs in corlib
    • honor RuntimeAsyncMethodGenerationAttribute attribute for override
    • check presence of feature flag runtime-async=on
    • check for return type
  • codegen for async methods
    • set method flag MethodImplOptions.Async
    • calls optimized with Await
      • selection of appropriate helper
    • calls using AwaitAwaiter/UnsafeAwaitAwaiter
    • await in catch/finally
    • await using
    • await foreach
    • ref local lifting (Runtime async support for hoisting by-refs #79763)
  • methods of validation
  • block unsupported scenarios for .NET 10 RC1
  • disallow application of MethodImplOptions.Async in source
  • public APIs
    • IOperation (no impact)
    • GetAwaitExpressionInfo
  • consider removing or downgrading the "no await" warning (related issue) Remove CS1998 warning entirely and remove dependent C# code fix providers #80144
  • analyzer work for RequiresPreviewFeatures (honor attribute on helper APIs)

Post-.NET 10

Async-iterators

  • codegen
  • debug info/symbols
  • EnC

Sub-issues

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions