Tagged Union Subsets with Comptime in Zig

from blog Mitchell Hashimoto, | ↗ original
Zig supports tagged unions1 and the Zig compiler will error if you switch on a tagged union without handling all possible cases. This is a great feature because it helps you avoid bugs when new cases are added to the union. Many languages support similar functionality.