Skip to content

Can AsyncMethodBuilder trust MoveNext? #7935

@benaadams

Description

@benaadams

AsyncXMethodBuilder Start<> can't inline as it uses a try+finally to restore the ExecutionContext

However, the generated state machine will always capture any exception and set it in the Task.

So... Question is can the MoveNext be trusted and the the try+finally removed?

Part of investigating https://github.com/dotnet/corefx/issues/18481

/cc @stephentoub

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions