{
  "id": 5192729,
  "title": "Microsoft devs rejoice: Union types coming to C# in November",
  "url": "https://urgent.news/2026/09/02/microsoft-devs-rejoice-union-types-coming-to-c-in-november",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-02T20:37:35.000Z",
  "source": {
    "name": "The Register",
    "slug": "the-register",
    "url": "https://www.theregister.com/devops/2026/09/02/microsoft-devs-rejoice-union-types-coming-to-c-in-november/5294056"
  },
  "original_language": "en",
  "account": "Microsoft developers are rejoicing as the company prepares to introduce union types in the upcoming C# 15 language release in November. Union types allow different custom data types to be grouped under a single umbrella type, providing a more flexible and compiler-verified contract compared to traditional hierarchies. This feature enables better pattern matching, custom functions, protection against rogue data types, stronger abstractions, and less boilerplate error code. Microsoft lead designer Mads Torgersen described union types as \"how unions should be,\" praising their ability to combine custom data types like \"Dog,\" \"Cat,\" and \"Bird\" into a single \"Pet\" type. The introduction of union types comes alongside the addition of closed hierarchies, which restrict direct inheritance in base classes to only derived types defined within the same assembly. This control measure prevents third-party subtypes from being compiled and spawning errors. Additionally, C# 15 expands the scope of the \"unsafe\" keyword, allowing developers to flag unsafe operations and maintain safety obligations, similar to Rust and Swift. Other new features in C# 15 include collection expression arguments, indexer declarations in extension blocks, and labels for break and continue statements in nested loops. Despite Redmond's shifting priorities towards cloud subscriptions and AI Copilot, Microsoft continues to update C#, now in its 20th year, to stay relevant in the ever-evolving programming landscape.",
  "summary": "The unsafe keyword will do more heavy lifting, while union types unify disparate forms of data",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 2,
    "also_reported_by": [
      {
        "outlet": "The Register Science",
        "title": "Microsoft devs rejoice: Union types coming to C# in November",
        "url": "https://urgent.news/2026/09/02/microsoft-devs-rejoice-union-types-coming-to-c-in-november-5195899",
        "published": "2026-09-02T20:37:35.000Z"
      }
    ]
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}