Skip to content

Fix comparer collection initializers#3328

Closed
theletterf wants to merge 3 commits into
mainfrom
fix-comparer-collection-initializers
Closed

Fix comparer collection initializers#3328
theletterf wants to merge 3 commits into
mainfrom
fix-comparer-collection-initializers

Conversation

@theletterf
Copy link
Copy Markdown
Member

Why

Current main fails to compile because the compiler treats the comparer with(...) collection expressions as calls to a missing method.

What

Replace those expressions with explicit Dictionary and HashSet constructors while preserving the intended case-insensitive comparers. Verified with dotnet build src/tooling/docs-builder/docs-builder.csproj -c Release --verbosity minimal.

Made with Cursor

Replace unsupported comparer collection expressions with explicit constructors so main builds with the configured .NET SDK.

Co-Authored-By: GPT-5.5 <noreply@openai.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@theletterf theletterf requested a review from a team as a code owner May 16, 2026 08:05
@theletterf theletterf added the bug label May 16, 2026
@theletterf theletterf requested a review from technige May 16, 2026 08:05
@theletterf theletterf added the bug label May 16, 2026
@elastic elastic deleted a comment from coderabbitai Bot May 16, 2026
Use capacity-plus-comparer constructors for empty collections so CI preserves custom comparers without triggering IDE0028 as an error.

Co-Authored-By: GPT-5.5 <noreply@openai.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@elastic elastic deleted a comment from coderabbitai Bot May 16, 2026
Use collection expressions as constructor input so style analyzers pass while the API explorer sets keep case-insensitive comparisons.

Co-Authored-By: GPT-5.5 <noreply@openai.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@elastic elastic deleted a comment from coderabbitai Bot May 16, 2026
@theletterf
Copy link
Copy Markdown
Member Author

Silly me, this is because I wasn't on the latest .NET.

@theletterf theletterf closed this May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant