Union types in C# 15: modeling closed sets of unrelated types

Mads Torgersen introduces union types coming in C# 15, showing how they let you model a closed set of unrelated types, create union values, and switch over them with full strong typing. He also points to a preview compiler you can try in Visual Studio and VS Code.

Overview

The video highlights union types as an upcoming C# feature.

What union types enable

Availability