Skip to content

[C# 15-Errors and warnings]: New Feature - Collection expression arguments #51441

@BillWagner

Description

@BillWagner

.NET 11 Preview

.NET 11 Preview 1

Link to speclet

Link to Pull request

Errors and warnings added for this feature

  • CS9354: 'with(...)' element must be the first element
  • CS9355: 'with(...)' elements are not supported for type '{0}'
  • CS9356: 'with(...)' element arguments cannot be dynamic
  • CS9357: 'with(...)' element for a read-only interface must be empty if present
  • CS9358: Element type of this collection may not be a ref struct or a type parameter allowing ref structs
  • CS9359: No overload for method '{0}' takes {1} 'with(...)' element arguments

There should already be an article with diagnostics for collection expressions. Add these to that article.

What language theme applies, for consolidation of articles

No response


Associated WorkItem - 550649

Metadata

Metadata

Assignees

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions