-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add note about ValueTask and ValueTask<TResult> default constructors (#4397) #4576
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
Conversation
I am not sure it is a good idea to document the default constructor that is automatically generated by the compiler. Usually users shouldn't use the default constructor. and If using the I'll let @stephentoub comment on that but his response may be delayed a little. |
Documenting what the status of a zero-initialized |
@tarekgh @stephentoub thanks for the feedback, I'll try a rewording to avoid such confusion. 👍🏻 |
In
changing |
I think this can be reasonable but I am not expecting users doing An instance created with parameterless constructor or by the default(ValueTask) syntax (a zero initialized structure) represents a synchronously, successfully completed operation. I am sure @stephentoub can rephrase it better :-) |
@glihm any chance you can follow up? |
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.
LGTM, thank you @glihm !
Docs Build status updates of commit a4e6c60: ✅ Validation status: passed
For more details, please refer to the build report. Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report. For any questions, please:
|
Fixes #4397
Summary
As described in the issue,
ValueTask
andValueTask<TResult>
are lacking of information about default constructors behavior.This PR is adding a note reworded from the code itself.