Skip to content

Proposal: Source Generation for Task returning methods #1940

@shmuelie

Description

@shmuelie

Summary

Right now, public async methods must return IAsnycAction, IAsnycActionWithProgress<TProgress>, IAsnycOperation<TResult>, or IAsnycOperationWithProgress<TResult, TProgress>. Instead, developers should be allowed to return Task and Task<T> and have a source generator create the "wrapping" version that returns the WinRT type.

Rationale

Usage of TPL things is much easier for developers, and allows for easier usage of async/await.

Important Notes

Should also support methods that have progress and cancelation.

Given RemoteThing.cs, the methods marked as [DebuggerNonUserCode] should be generated for the user

Open Questions

Should this be the default or should it be opt-in?

Metadata

Metadata

Assignees

No one assigned

    Labels

    authoringRelated to authoring feature work

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions