<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/explore-new-features-available-in-c-15-preview-plkkrytfs" -->

---
title: Explore new features available in C# 15 preview | daily.dev
description: C# 15, shipping with .NET 11 in November, is available now in .NET 11 preview 7. New features include union types (constraining a value to a specified set of...
canonical: https://daily.dev/posts/explore-new-features-available-in-c-15-preview-plkkrytfs
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Explore new features available in C# 15 preview | daily.dev
og:description: C# 15, shipping with .NET 11 in November, is available now in .NET 11 preview 7. New features include union types (constraining a value to a specified set of...
og:url: https://daily.dev/posts/explore-new-features-available-in-c-15-preview-plkkrytfs
og:image: https://api.daily.dev/og/posts/PLkKRYtfs.png
og:image:alt: Explore new features available in C# 15 preview
og:image:width: 1200
og:image:height: 630
og:locale: en
---

[.NET Blog](https://daily.dev/sources/dotnet)

[Read post](https://api.daily.dev/r/PLkKRYtfs)

# [Explore new features available in C# 15 preview](https://api.daily.dev/r/PLkKRYtfs "Go to post")

C# 15, shipping with .NET 11 in November, is available now in .NET 11 preview 7\. New features include union types (constraining a value to a specified set of case types with exhaustive switch support), closed hierarchies (restricting class derivation to the declaring assembly), a preview redesign of the unsafe model that allows pointer declarations outside unsafe contexts while still gating dereferencing operations, collection expression arguments via a new with(...) syntax, extension indexers building on C# 14's extension members, and labeled break/continue for exiting nested loops directly. The unsafe model changes require explicit opt-in via project file settings and may still change before C# 16.

[#.net](/tags/.net "Check all #.net posts")[#c#](/tags/c%23 "Check all #c# posts")[#type-systems](/tags/type-systems "Check all #type-systems posts")

Aug 24•6m read time•From [devblogs.microsoft.com](https://api.daily.dev/r/PLkKRYtfs "devblogs.microsoft.com")

[![Post cover image](https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ced7688c72540987ad87211f470ba318?_a=AQAEuop)](https://api.daily.dev/r/PLkKRYtfs "Go to post")

Table of contents

[Union types Copy link](https://api.daily.dev/r/PLkKRYtfs?a=union-types "Union types Copy link")[Closed hierarchies Copy link](https://api.daily.dev/r/PLkKRYtfs?a=closed-hierarchies "Closed hierarchies Copy link")[Memory-safety redesign (preview) Copy link](https://api.daily.dev/r/PLkKRYtfs?a=memory-safety-redesign-%28preview%29 "Memory-safety redesign (preview) Copy link")[Collection expression arguments Copy link](https://api.daily.dev/r/PLkKRYtfs?a=collection-expression-arguments "Collection expression arguments Copy link")[Extension indexers Copy link](https://api.daily.dev/r/PLkKRYtfs?a=extension-indexers "Extension indexers Copy link")[Labeled break and continue Copy link](https://api.daily.dev/r/PLkKRYtfs?a=labeled-break-and-continue "Labeled break and continue Copy link")[Try the preview Copy link](https://api.daily.dev/r/PLkKRYtfs?a=try-the-preview "Try the preview Copy link")

Questions this post answers

What are union types in C# 15?

Union types let you constrain a value to one of a specified set of case types declared with the new union keyword, for example public union Pet(Cat, Dog, Bird). Each case type converts implicitly to the union type, and because the compiler knows the complete set, a switch expression over a non-null union value is exhaustive without needing a discard or default arm. Track C# 15 language additions like this on daily.dev as .NET 11 approaches release.

How does the C# 15 preview change the unsafe keyword and pointer rules?

In the C# 15 preview memory-safety redesign, pointer types, address-of with &, fixed statements, stackalloc-to-pointer conversion, and sizeof on unmanaged types no longer require an unsafe context, but dereferencing operations like \*p, p->m, p\[i\], fixed-size-buffer access, and function-pointer invocation still do. Adding unsafe to a member's signature now restricts callers to unsafe contexts, a breaking change from prior semantics, and requires opting in via updated-memory-safety-rules and LangVersion preview in the project file. Developers evaluating this breaking unsafe behavior can follow the discussion on daily.dev before adopting the preview.

How do I pass constructor arguments in a C# collection expression?

C# 15 adds a with(...) element written first in a collection expression that forwards arguments to the underlying constructor or Create method, for example List<string> names = \[with(capacity: values.Length \* 2), .. values\] or HashSet<string> set = \[with(StringComparer.OrdinalIgnoreCase), "Hello", "HELLO"\]. This also lays groundwork for the upcoming dictionary expressions syntax, which will often need to specify a comparer. Keep up with syntax additions like this via daily.dev when adopting new C# collection expression features.

23.9K Impressions13 Upvotes

Comment

Bookmark

Copy

![Placeholder image for anonymous user](https://media.daily.dev/image/upload/s--qsFuKGv_--/t_logo,f_auto/public/noProfile)Share your thoughtsPost

[![.NET Blog's image](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/f23eb59371bd4f07aeef64c4eef73266)](https://daily.dev/sources/dotnet)

[.NET Blog](https://daily.dev/sources/dotnet "https://daily.dev/sources/dotnet")

dotnet offers insights into .NET development, C# programming language, and cross-platform applicatio... Read more

1.2K Followers

•

2.3K Upvotes

#### Would you recommend this post?

Copy link

WhatsApp

Facebook

X

New Squad

Copy linkShare with your friends

13

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Explore new features available in C# 15 preview","url":"https://daily.dev/posts/explore-new-features-available-in-c-15-preview-plkkrytfs","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/explore-new-features-available-in-c-15-preview-plkkrytfs"},"datePublished":"2026-08-24T17:03:33.501Z","dateModified":"2026-08-24T17:03:58.460Z","description":"C# 15, shipping with .NET 11 in November, is available now in .NET 11 preview 7. New features include union types (constraining a value to a specified set of...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ced7688c72540987ad87211f470ba318?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ced7688c72540987ad87211f470ba318?_a=AQAEuop","isAccessibleForFree":true,"articleSection":".NET Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":".NET Blog","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/f23eb59371bd4f07aeef64c4eef73266","url":"https://daily.dev/sources/dotnet"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/explore-new-features-available-in-c-15-preview-plkkrytfs","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":13},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":".net,c#,type-systems","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":".NET Blog","item":"https://daily.dev/sources/dotnet"},{"@type":"ListItem","position":3,"name":"Explore new features available in C# 15 preview"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/explore-new-features-available-in-c-15-preview-plkkrytfs#faq","mainEntity":[{"@type":"Question","name":"What are union types in C# 15?","acceptedAnswer":{"@type":"Answer","text":"Union types let you constrain a value to one of a specified set of case types declared with the new union keyword, for example public union Pet(Cat, Dog, Bird). Each case type converts implicitly to the union type, and because the compiler knows the complete set, a switch expression over a non-null union value is exhaustive without needing a discard or default arm. Track C# 15 language additions like this on daily.dev as .NET 11 approaches release."}},{"@type":"Question","name":"How does the C# 15 preview change the unsafe keyword and pointer rules?","acceptedAnswer":{"@type":"Answer","text":"In the C# 15 preview memory-safety redesign, pointer types, address-of with &, fixed statements, stackalloc-to-pointer conversion, and sizeof on unmanaged types no longer require an unsafe context, but dereferencing operations like *p, p->m, p[i], fixed-size-buffer access, and function-pointer invocation still do. Adding unsafe to a member's signature now restricts callers to unsafe contexts, a breaking change from prior semantics, and requires opting in via updated-memory-safety-rules and LangVersion preview in the project file. Developers evaluating this breaking unsafe behavior can follow the discussion on daily.dev before adopting the preview."}},{"@type":"Question","name":"How do I pass constructor arguments in a C# collection expression?","acceptedAnswer":{"@type":"Answer","text":"C# 15 adds a with(...) element written first in a collection expression that forwards arguments to the underlying constructor or Create method, for example List<string> names = [with(capacity: values.Length * 2), .. values] or HashSet<string> set = [with(StringComparer.OrdinalIgnoreCase), \"Hello\", \"HELLO\"]. This also lays groundwork for the upcoming dictionary expressions syntax, which will often need to specify a comparer. Keep up with syntax additions like this via daily.dev when adopting new C# collection expression features."}}]}
```

