<!-- 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
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Explore new features available in C# 15 preview

**[.NET Blog](https://daily.dev/sources/dotnet)** · 6 min read · 13 upvotes · 0 comments

## Summary

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.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://devblogs.microsoft.com/dotnet/explore-csharp-15>

## Questions this post answers

### What are union types in C# 15?

Union types in C# 15 let you declare a type as one of a fixed set of case types, such as 'public union Pet(Cat, Dog, Bird)'. Each case type implicitly converts to the union, and a switch expression over a non-null union value is exhaustive without needing a discard or default arm, since the compiler knows the complete set of possible types.

_daily.dev surfaces language updates like this for developers deciding when to adopt new C# type-safety features._

### How does the unsafe code model change in C# 15?

C# 15 previews a redesign where pointer types, address-of operations, fixed statements, stackalloc-to-pointer conversions, and sizeof on unmanaged types no longer require an unsafe context, while dereferencing pointers still does. It's opt-in via '<Features>updated-memory-safety-rules</Features>' and '<LangVersion>preview</LangVersion>', and adding the unsafe modifier to a member signature is a breaking change restricting who can call it.

_Developers planning an unsafe-code migration can track this preview's evolution on daily.dev before it lands in C# 16._

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

C# 15 adds a with(...) element written first in a collection expression to forward 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 underpins the upcoming dictionary expressions syntax.

_Teams adopting new collection expression syntax can follow C# language changes as they ship on daily.dev._

## Similar posts on daily.dev

- [Explore union types in C\# 15](https://daily.dev/posts/explore-union-types-in-c-15-oygraauhf) · DevBlogs · 64 upvotes · 3 comments

---

Tags: [#.net](https://daily.dev/tags/.net), [#c#](https://daily.dev/tags/c#), [#type-systems](https://daily.dev/tags/type-systems)

[View this post on daily.dev](https://daily.dev/posts/explore-new-features-available-in-c-15-preview-plkkrytfs)

```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-09-14T06:55:26.096Z","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 in C# 15 let you declare a type as one of a fixed set of case types, such as 'public union Pet(Cat, Dog, Bird)'. Each case type implicitly converts to the union, and a switch expression over a non-null union value is exhaustive without needing a discard or default arm, since the compiler knows the complete set of possible types. daily.dev surfaces language updates like this for developers deciding when to adopt new C# type-safety features."}},{"@type":"Question","name":"How does the unsafe code model change in C# 15?","acceptedAnswer":{"@type":"Answer","text":"C# 15 previews a redesign where pointer types, address-of operations, fixed statements, stackalloc-to-pointer conversions, and sizeof on unmanaged types no longer require an unsafe context, while dereferencing pointers still does. It's opt-in via '<Features>updated-memory-safety-rules</Features>' and '<LangVersion>preview</LangVersion>', and adding the unsafe modifier to a member signature is a breaking change restricting who can call it. Developers planning an unsafe-code migration can track this preview's evolution on daily.dev before it lands in C# 16."}},{"@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 to forward 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 underpins the upcoming dictionary expressions syntax. Teams adopting new collection expression syntax can follow C# language changes as they ship on daily.dev."}}]}
```

