Skip Navigation

Discriminated unions proposals overview (might come in C# 16)

csharplang/meetings/working-groups/discriminated-unions/union-proposals-overview.md at main · dotnet/csharplang

The official repo for the design of the C# programming language - dotnet/csharplang

A discriminated union is a data structure that can hold one of several distinct types of data. This type-safety allows developers to build complex data structures, like API responses or state machine events, and ensures all possible cases are handled, preventing runtime errors.

This is a proposal that might come in C# 16

If you prefer this as a video explanation then Nick Chapsas made one: https://www.youtube.com/watch?v=tD46WVJ2h9I

Comments

2