-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
No errors reported at use-site for task type with inaccessible builder type #71283
Milestone
Comments
The compiler is currently checking the declared accessibility of the builder type matches exactly the declared accessibility of the task type. Instead, the compiler should simply check the builder type is accessible at the use-site of the task type. |
BillWagner
added a commit
to BillWagner/csharpstandard
that referenced
this issue
Dec 15, 2023
Clarify the required accessibility of any task builder type and its required members. Note that we will need to update this text once dotnet/roslyn#71283 is fixed and merged.
BillWagner
added a commit
to BillWagner/csharpstandard
that referenced
this issue
Dec 15, 2023
Clarify the required accessibility of any task builder type and its required members. Note that we will need to update this text once dotnet/roslyn#71283 is fixed and merged.
BillWagner
added a commit
to dotnet/csharpstandard
that referenced
this issue
Feb 7, 2024
* "produces a result" vs. "return a value" Fixes #857 For an async method, say "produces a result value" vs. "return a value" when describing the rules for the returned "task type". * Add note about identity convertible Fixes #878 I made this a note, rather than normative language. I read the existing text to allow the example in the issue (as does the roslyn implementation). * Describe task cancelled state Fixes #775 Add a bullet to the list specifying that an `OperationCanceledException` puts the returned task in the cancelled state. This meant adding `OperationCanceledException` to the types in Annex C. I chose this fix because all known task builders conform to this behavior. It seems reasonable to standardize it. * Fixes #879 Clarify the required accessibility of any task builder type and its required members. Note that we will need to update this text once dotnet/roslyn#71283 is fixed and merged. * Add clarifying note. The normative language on exactly matching accessibility is all that's strictly needed. But, I added a note about the implications for nested types and internal types. * Fix missing exception type. * Apply suggestions from code review * Apply suggestions from code review * Apply suggestions from code review * Update standard/classes.md
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps to Reproduce:
Compile Example 2 from dotnet/csharpstandard#879.
See sharplab.io
Expected Behavior:
Error compiling
C.M
since the task builder type is inaccessible at that use-site.Actual Behavior:
No errors.
The text was updated successfully, but these errors were encountered: