Skip to content

Conversation

Build the initial framework for What's new in C# 15.
Edit and update text for style.
@BillWagner BillWagner marked this pull request as ready for review February 4, 2026 16:32
@BillWagner BillWagner requested a review from a team as a code owner February 4, 2026 16:32
@BillWagner BillWagner requested review from adegeo and Copilot February 4, 2026 16:32
@BillWagner
Copy link
Member Author

@adegeo I marked this ready for review even though the new examples don't build.

They should once .NET 11 preview 1 is out. I'll fix the samples and then (hopefully) merge.

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 adds preview documentation for C# 15's collection expression arguments feature, which allows passing constructor or factory method arguments to collections using a with(...) element in collection expressions. The documentation is being prepared for .NET 11 and Visual Studio 2026.

Changes:

  • New documentation file for C# 15 with collection expression arguments feature
  • Updated collection expressions reference documentation with detailed sections on constructor arguments, collection builder arguments, and interface target types
  • Updated object and collection initializers programming guide with new collection expression arguments section
  • Configuration updates to TOC files, language version tables, and build configuration

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
docs/csharp/whats-new/csharp-15.md New file introducing C# 15 with collection expression arguments feature
docs/csharp/language-reference/operators/collection-expressions.md Added comprehensive documentation for collection expression arguments including usage examples and restrictions
docs/csharp/programming-guide/classes-and-structs/object-and-collection-initializers.md Updated guide with collection expression arguments section and style improvements throughout
docs/csharp/language-reference/operators/snippets/shared/CollectionExpressionExamples.cs Added code examples demonstrating collection expression arguments with custom types
docs/csharp/programming-guide/classes-and-structs/snippets/object-collection-initializers/CollectionExpressionArguments.cs New code snippet file with collection expression arguments examples
docs/csharp/language-reference/operators/snippets/shared/operators.csproj Updated target framework to net11.0 and added preview language version
docs/csharp/programming-guide/classes-and-structs/snippets/object-collection-initializers/object-collection-initializers.csproj Updated target framework to net11.0 and added preview language version
docs/csharp/toc.yml Added C# 15 entry and breaking changes link for .NET 11
docs/csharp/specification/toc.yml Added link to collection expression arguments specification
docs/csharp/language-reference/language-versioning.md Updated to reference C# 15 and .NET 11 support
docs/csharp/language-reference/includes/langversion-table.md Added C# 15.0 language version entry
docs/csharp/language-reference/includes/default-langversion-table.md Added .NET 11 mapping to C# 15
docfx.json Added configuration for breaking changes file and collection expression arguments proposal
.openpublishing.redirection.csharp.json Updated redirects to point to C# 15 as latest version

BillWagner and others added 3 commits February 4, 2026 11:45
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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-Fundamentals and reference]: New Feature - Collection expression arguments

1 participant