Add additional compiler diagnostics related to applying attributes#51739
Open
BillWagner wants to merge 9 commits intodotnet:mainfrom
Open
Add additional compiler diagnostics related to applying attributes#51739BillWagner wants to merge 9 commits intodotnet:mainfrom
BillWagner wants to merge 9 commits intodotnet:mainfrom
Conversation
Found other potential errors to consolidate around the theme of attribute usage.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #51446 by consolidating multiple attribute-related compiler error diagnostics into a single comprehensive article. The changes move individual error documentation pages to a unified "Attribute declaration and usage" article, making it easier to find and understand related errors.
Changes:
- Consolidates 23 attribute-related compiler errors (CS0181, CS0579, CS0592, CS0616, CS0647, CS0668, CS0735, CS0739, CS1608, CS1614, CS1618, CS1667, CS1689, CS8959-CS8963, CS8968, CS8970) into
attribute-usage-errors.md - Adds new section for CallerArgumentExpression attribute errors (CS8959-CS8963) as requested in issue #51446
- Includes generic attribute type errors (CS8968, CS8970) as requested in issue #51446
- Creates redirects for all deleted individual error pages to the consolidated article
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/csharp/language-reference/compiler-messages/attribute-usage-errors.md | Expanded with 23 additional error codes organized into 6 logical sections: Attribute arguments and parameters, Attribute class requirements, Attribute location context, Predefined attributes, Conditional attribute usage, and CallerArgumentExpression attribute usage |
| docs/csharp/language-reference/tokens/verbatim.md | Updated CS1614 reference link to point to the new consolidated article with appropriate anchor |
| docs/csharp/language-reference/toc.yml | Updated displayName to include all new error codes and removed individual TOC entries for deleted files |
| docs/csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-error.md | Removed error codes that now have documentation |
| .openpublishing.redirection.csharp.json | Added 13 redirects for deleted individual error pages |
| docs/csharp/language-reference/compiler-messages/cs0181.md | Deleted (moved to consolidated article) |
| docs/csharp/language-reference/compiler-messages/cs0579.md | Deleted (moved to consolidated article) |
| docs/csharp/language-reference/compiler-messages/cs0592.md | Deleted (moved to consolidated article) |
| docs/csharp/language-reference/compiler-messages/cs0616.md | Deleted (moved to consolidated article) |
| docs/csharp/language-reference/compiler-messages/cs1614.md | Deleted (moved to consolidated article) |
| docs/csharp/misc/cs0647.md | Deleted (moved to consolidated article) |
| docs/csharp/misc/cs0668.md | Deleted (moved to consolidated article) |
| docs/csharp/misc/cs0735.md | Deleted (moved to consolidated article) |
| docs/csharp/misc/cs0739.md | Deleted (moved to consolidated article) |
| docs/csharp/misc/cs1608.md | Deleted (moved to consolidated article) |
| docs/csharp/misc/cs1618.md | Deleted (moved to consolidated article) |
| docs/csharp/misc/cs1667.md | Deleted (moved to consolidated article) |
| docs/csharp/misc/cs1689.md | Deleted (moved to consolidated article) |
docs/csharp/language-reference/compiler-messages/attribute-usage-errors.md
Outdated
Show resolved
Hide resolved
docs/csharp/language-reference/compiler-messages/attribute-usage-errors.md
Outdated
Show resolved
Hide resolved
BillWagner
commented
Feb 13, 2026
docs/csharp/language-reference/compiler-messages/attribute-usage-errors.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #51446
Also, Copilot suggested additional diagnostics that relate to the same topic.
Internal previews
@in variables, attributes, and string literals