-
Notifications
You must be signed in to change notification settings - Fork 86
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
C# V7: Generalized async return types #556
C# V7: Generalized async return types #556
Conversation
I've asked @ljw1004 to look at this. |
The PR for local functions will be merged before this one. This PR should be updated per #104 (comment) to address other allowed return types in async local functions. |
3cd7b95
to
6ca8ee0
Compare
See #345 for more questions on this feature (Rex closed 345 on 2023-02-19.) |
cafc0b2
to
21a9c80
Compare
I added the declarations in §C.3 for
I addressed all of these by adding the text for the semantics of the
I added the first rule to "Exactly matching expression". The second and third I added to "Better conversion target". |
No further comments for any invited reviewers. @jskeet Can we look at this one for the upcoming meeting as well? |
Yup, absolutely. Please add the label - it's fiddly to do on my phone... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments - I'm okay to go with a somewhat vague wording for «TaskType»
in the hope that we tighten it up before final submission.
(There are a few other changes that should be easier to make or reject.)
This attribute is now needed for the generalized async return types.
This commit adds the description of the expected semantics for a Task type builder pattern, the additional rules for overload resolution, and the new types needed in the Standard Library annex.
Co-authored-by: Jon Skeet <skeet@pobox.com>
460f29a
to
f0cea5e
Compare
@jskeet Async return types is rebased and ready for the upcoming meeting. |
Co-authored-by: Jon Skeet <skeet@pobox.com>
Approved on 2023-05-17 meeting. |
Questions re 14.15 Async Functions|14.15.1 General:
A. Re
System.Runtime.CompilerServices.AsyncMethodBuilder
, in the absence of a CLI spec update, presumably, we’ll need to spec this attribute type. Or at least update §C.3, “Standard Library Types not defined in ISO/IEC 23271” to include this new Attribute type.B. §11.8.8.2, “Awaitable expressions,” allows for the possibility of the awaiter implementing
ICriticalNotifyCompletion
. What, if anything, should we say about awaiter/builder types being required/permitted to implement ICriticalNotifyCompletion?Bill W.: Maybe. We (the ECMA committee) stuck with just INotifyCompletion. As such, this may be an implementation detail. Let’s discuss in committee.
C. Where are the semantics of the TaskBuilderType methods defined? Is there some sort of IBuilderMembers interface that an awaiter should implement, or does the awaiter simply have to declare each of those members?
Bill W.: My first thought is to follow the example of LINQ query expressions: A type must follow a “shape”, but what those methods actually do isn’t spelled out in detail in the spec.
D. Is there some spec for the V6 state-machine code generation for
Task
andTask<T>
that I can adapt for all task types?Bill W. I don’t think so, but from my comment above, we may not need to add this.
E: In which section should the spec for state-machine code generation go? In the async-return spec it’s listed under “Execution.”
Bill W. Do you think we need something like this: §12.17.3 Query expression translation? That’s my first thought.
General question:
F. How/where do I merge in the text from the async-return spec section “Overload Resolution?” Maybe in 11.6.4.5, “Exactly matching expression.”
@gafter On yesterday's TG2 call you said you'd like to run this PR by an expert. I've spec'd all that I can for this feature, and listed the open issues above.