Skip to content

Add a page for errors in union declarations#52860

Merged
BillWagner merged 5 commits intodotnet:mainfrom
BillWagner:errors-unions
Apr 7, 2026
Merged

Add a page for errors in union declarations#52860
BillWagner merged 5 commits intodotnet:mainfrom
BillWagner:errors-unions

Conversation

@BillWagner
Copy link
Copy Markdown
Member

@BillWagner BillWagner commented Apr 3, 2026

@dotnetrepoman dotnetrepoman bot added this to the April 2026 milestone Apr 3, 2026
@BillWagner BillWagner marked this pull request as ready for review April 3, 2026 20:56
@BillWagner BillWagner requested a review from a team as a code owner April 3, 2026 20:56
Copilot AI review requested due to automatic review settings April 3, 2026 20:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.md documenting CS9370–CS9375 with guidance and links back to the union feature docs/spec.
  • Update expression-tree-restrictions.md to 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.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Bill Wagner <wiwagn@microsoft.com>
@BillWagner BillWagner requested a review from adegeo April 6, 2026 17:16
Copy link
Copy Markdown
Contributor

@adegeo adegeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@BillWagner BillWagner merged commit f10150b into dotnet:main Apr 7, 2026
9 checks passed
@BillWagner BillWagner deleted the errors-unions branch April 7, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C# 15-Errors and warnings]: New Feature - unions

3 participants