Skip to content
0:00 / 0:00

#uniontypes#c#15#madstorgersen

Union types in C# | DEM304

Microsoft Developer

700K subscribers • 17 videos on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.
  • Presented by Mads Torgersen, Lead Designer of C#
  • Made by the vendor. The company whose product it covers made or sponsored it.

Intermediate. Assumes working knowledge.

22K views5 months ago1 recommendation

Programming languagesC# and .NETLanguage design and type systems

Mads Torgersen and Dustin Campbell demonstrate the upcoming union types feature in C# at Microsoft Build 2026.

Union types are coming to C#! Unions model closed sets of data shapes, as commonly seen in e.g. wire protocols. Mads and Dustin explore the clean expression of intent and the confidence and elegance that unions lend to consuming code. Seating for this session is first-come, first-served. Add it to your schedule to plan your day and arrive early to secure a spot. To learn more, please check out these resources: * aka.ms/build26/DEM304 * aka.ms/build26/csharp/union-types 𝗦𝗽𝗲𝗮𝗸𝗲𝗿𝘀: * Dustin Campbell * Mads Torgersen 𝗦𝗲𝘀𝘀𝗶𝗼𝗻 𝗜𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻: This is one of many sessions from the Microsoft Build 2026 event. View even more sessions on-demand and learn about Microsoft Build at build.microsoft.com DEM304 | English (US) | Developer tools & frameworks Demo | (400) Expert #MSBuild Chapters: - Introduction by C# team members Mads Torgersen and Dustin Campbell - Creating calculated properties and managing state - Restricting unions to functional members without extra state - Demonstrating exhaustive switch handling for success and error cases - Explaining union type implementation using structs - Performance considerations and custom union implementations - Description of C# feature patterns where users can implement conventions themselves - Summary of manual union writing and internal struct design for performance considerations - Conclusion referencing multi-year design process and preview availability in Visual Studio and VS Code

Why it's here

1 person recommends this

What people say. Recommended as an exciting preview of the upcoming union types feature in C#.

u/EntroperZeroin r/dotnet • Recommends

Unions in C# 15 with Mads Torgersen and Dustin Campbell