Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Source Generation for Task returning methods #1940

Open
shmuelie opened this issue Feb 28, 2025 · 0 comments
Open

Proposal: Source Generation for Task returning methods #1940

shmuelie opened this issue Feb 28, 2025 · 0 comments
Labels
authoring Related to authoring feature work

Comments

@shmuelie
Copy link

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?

@manodasanW manodasanW added the authoring Related to authoring feature work label Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
authoring Related to authoring feature work
Projects
None yet
Development

No branches or pull requests

2 participants