Skip to content

[WIP]fix: revert invalid [with(...)] collection syntax #3366

Closed
groman92 wants to merge 4 commits into
mainfrom
revert-with-syntax
Closed

[WIP]fix: revert invalid [with(...)] collection syntax #3366
groman92 wants to merge 4 commits into
mainfrom
revert-with-syntax

Conversation

@groman92
Copy link
Copy Markdown
Contributor

@groman92 groman92 commented May 20, 2026

NEED to investigate this.

Commit ("Fix new SDK Warnings") introduced [with(...)] as a syntax for creating collections with a custom comparer:

// What was introduced (not valid C#)
private readonly Dictionary<string, string> _substitutions = [with(StringComparer.OrdinalIgnoreCase)];

// What it should be
private readonly Dictionary<string, string> _substitutions = new(StringComparer.OrdinalIgnoreCase);
[with(...)] is not valid in any released C# version, including the C# 14 preview shipping with .NET 10. Inside a collection expression [...], with is treated as an identifier name — not a keyword — causing CS0103: The name 'with' does not exist in the current context. This broke the build for anyone pulling main after that commit.

@groman92 groman92 had a problem deploying to integration-tests May 20, 2026 15:51 — with GitHub Actions Failure
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 20, 2026

Label error. Requires exactly 1 of: automation, breaking, bug, changelog:skip, chore, ci, dependencies, documentation, enhancement, feature, fix, redesign. Found: build

@groman92 groman92 changed the title fix: revert invalid [with(...)] collection syntax [WIP]fix: revert invalid [with(...)] collection syntax May 20, 2026
@groman92 groman92 added bug build relates to invocation of the tool(s) and removed bug labels May 20, 2026
@groman92 groman92 had a problem deploying to integration-tests May 21, 2026 07:18 — with GitHub Actions Failure
@groman92 groman92 had a problem deploying to integration-tests May 21, 2026 07:33 — with GitHub Actions Failure
@groman92 groman92 closed this May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build relates to invocation of the tool(s)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant