Add a page for errors in union declarations#52860
Merged
BillWagner merged 5 commits intodotnet:mainfrom Apr 7, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds documentation coverage for new C# 15 union-related compiler diagnostics by introducing a dedicated union declaration diagnostics page, wiring it into the C# language reference TOC, and relocating the expression-tree-specific union diagnostic to the existing expression tree restrictions page.
Changes:
- Add
union-declaration-errors.mddocumenting CS9370–CS9375 with guidance and links back to the union feature docs/spec. - Update
expression-tree-restrictions.mdto include CS9369 (union conversions in expression trees) in keyword metadata and the diagnostics list. - Update the C# language reference TOC to link the new union diagnostics page and include CS9369 under expression tree restrictions; remove union diagnostics keywords from the generic “sorry” page.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| docs/csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-error.md | Removes union-related F1 keywords now covered by dedicated pages. |
| docs/csharp/language-reference/toc.yml | Adds TOC entry for union declaration diagnostics and indexes CS9369 under expression tree restrictions. |
| docs/csharp/language-reference/compiler-messages/union-declaration-errors.md | New diagnostics page for union declaration errors (CS9370–CS9375). |
| docs/csharp/language-reference/compiler-messages/expression-tree-restrictions.md | Adds CS9369 metadata and content to the expression tree restrictions diagnostics page. |
docs/csharp/language-reference/compiler-messages/union-declaration-errors.md
Show resolved
Hide resolved
docs/csharp/language-reference/compiler-messages/union-declaration-errors.md
Show resolved
Hide resolved
docs/csharp/language-reference/compiler-messages/union-declaration-errors.md
Outdated
Show resolved
Hide resolved
docs/csharp/language-reference/compiler-messages/union-declaration-errors.md
Outdated
Show resolved
Hide resolved
docs/csharp/language-reference/compiler-messages/expression-tree-restrictions.md
Outdated
Show resolved
Hide resolved
docs/csharp/language-reference/compiler-messages/union-declaration-errors.md
Outdated
Show resolved
Hide resolved
BillWagner
commented
Apr 3, 2026
docs/csharp/language-reference/compiler-messages/union-declaration-errors.md
Outdated
Show resolved
Hide resolved
BillWagner
commented
Apr 3, 2026
docs/csharp/language-reference/compiler-messages/union-declaration-errors.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Bill Wagner <wiwagn@microsoft.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 #52321
Add a new diagnostic page for errors related to union declarations. Note that one error is in the expression tree file because it's a better fit there.
Internal previews