Skip to content

Add new diagnostics for with#51514

Merged
BillWagner merged 2 commits intodotnet:mainfrom
BillWagner:collection-argument-diagnostics
Feb 5, 2026
Merged

Add new diagnostics for with#51514
BillWagner merged 2 commits intodotnet:mainfrom
BillWagner:collection-argument-diagnostics

Conversation

@BillWagner
Copy link
Member

@BillWagner BillWagner commented Feb 4, 2026

Fixes dotnet#51441

The feature for collection expression arguments adds these six diagnostic codes.
Copy link
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

This PR wires up documentation for the new with(...) collection expression argument diagnostics and removes them from the generic “sorry, we don’t have specifics” catch-all page. It also updates TOC metadata so the new diagnostics are discoverable from the language reference.

Changes:

  • Removed CS9354–CS9359 from the generic sorry-we-don-t-have-specifics-on-this-csharp-error.md list now that they have dedicated coverage.
  • Added CS9354–CS9359 to array-declaration-errors.md, including F1/helpviewer keywords, the error list, and guidance on how to resolve the diagnostics, and updated ms.date.
  • Updated language-reference/toc.yml display names to surface the new diagnostics in navigation (though currently pointing them at the inline arrays entry instead of the array/collection declarations entry).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
docs/csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-error.md Updates ms.date, adds C# version grouping comments, and removes CS9354–CS9359 from the undocumented diagnostics list now that they are documented elsewhere.
docs/csharp/language-reference/toc.yml Extends the inline arrays compiler-messages TOC entry’s displayName list to include CS9354–CS9359, but does not yet add them to the array declarations entry where the new content actually lives.
docs/csharp/language-reference/compiler-messages/array-declaration-errors.md Adds CS9354–CS9359 to F1/helpviewer keywords, the “covered errors” list, and the guidance section for collection expression/initializer diagnostics, and updates ms.date and metadata accordingly.

@BillWagner
Copy link
Member Author

@adegeo This is ready for review.

@BillWagner BillWagner merged commit 3bf3b24 into dotnet:main Feb 5, 2026
9 checks passed
@BillWagner BillWagner deleted the collection-argument-diagnostics branch February 5, 2026 15:07
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 - Collection expression arguments

2 participants