# union types

A type-system construct representing values that may conform to any one of two or more member types.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## .NET 11 : ASP.NET Core: Union Type Support, OpenAPI 3.2 by Default and Blazor AI Components

DevFeed: [.NET 11 : ASP.NET Core: Union Type Support, OpenAPI 3.2 by Default and Blazor AI Components](<https://devfeed.tech/articles/net-11-asp-net-core-union-type-support-openapi-3-2-by-default-and-blazor-ai-components-143688.md>)

Original publisher: [Read original article](<https://www.infoq.com/news/2026/11/asp-net-11-release/>)

Author: Almir Vuk

Published: 2026-11-19T11:27:00Z

Content type: article

Language: en

Sources: [InfoQ](<https://devfeed.tech/sources/infoq.md>)

Topics: [ASP.NET Core](<https://devfeed.tech/topics/asp-net-core.md>), [Blazor](<https://devfeed.tech/topics/blazor.md>), [SignalR](<https://devfeed.tech/topics/signalr.md>), [Minimal API](<https://devfeed.tech/topics/minimal-api.md>), [OpenAPI Specification](<https://devfeed.tech/topics/openapi.md>), [union types](<https://devfeed.tech/topics/union-types.md>), [.NET](<https://devfeed.tech/topics/net.md>)

Tags: [apis](<https://devfeed.tech/tags/apis.md>), [asp-net](<https://devfeed.tech/tags/asp-net.md>), [asp-net-11-release](<https://devfeed.tech/tags/asp-net-11-release.md>), [asp-net-core](<https://devfeed.tech/tags/asp-net-core.md>), [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [authentication](<https://devfeed.tech/tags/authentication.md>), [blazor](<https://devfeed.tech/tags/blazor.md>), [c-sharp](<https://devfeed.tech/tags/c-sharp.md>), [components](<https://devfeed.tech/tags/components.md>), [development](<https://devfeed.tech/tags/development.md>), [experimental](<https://devfeed.tech/tags/experimental.md>), [json](<https://devfeed.tech/tags/json.md>), [minimal](<https://devfeed.tech/tags/minimal.md>), [net](<https://devfeed.tech/tags/net.md>), [net-10](<https://devfeed.tech/tags/net-10.md>), [net-11](<https://devfeed.tech/tags/net-11.md>), [net-9](<https://devfeed.tech/tags/net-9.md>), [news](<https://devfeed.tech/tags/news.md>), [openapi](<https://devfeed.tech/tags/openapi.md>), [refresh](<https://devfeed.tech/tags/refresh.md>), [signalr](<https://devfeed.tech/tags/signalr.md>), [ssr](<https://devfeed.tech/tags/ssr.md>), [union](<https://devfeed.tech/tags/union.md>), [validation](<https://devfeed.tech/tags/validation.md>), [zstandard](<https://devfeed.tech/tags/zstandard.md>)

### AI overview

ASP.NET Core in .NET 11 adds C# 15 union types for JSON request and response bodies in Minimal APIs and MVC, asynchronous Minimal API validation, and OpenAPI 3.2 generation by default. Union binding is limited to JSON bodies, and OpenAPI 3.2 depends on Microsoft.OpenApi 3.3.1, which the release notes identify as a breaking change. SignalR can refresh authentication without closing long-lived connections; setup is per hub on the server, while .NET refreshes automatically by default and TypeScript can also do so. Blazor adds cached component markup, default client-side validation for static SSR forms, and opt-in circuit pausing for hidden tabs. Its experimental AI components remain prerelease throughout .NET 11. Zstandard compression is enabled by default. The release also includes Kestrel and other API changes, with .NET 11 described as a two-year Standard Term Support release.

### Source excerpt

Microsoft has released ASP.NET Core in .NET 11. The update adds C# union type support in JSON bodies, asynchronous validation for Minimal APIs, OpenAPI 3.2 by default, and SignalR authentication refresh. Blazor gains a CacheView component, client-side validation for static SSR forms, opt-in circuit pause for inactive tabs, and experimental AI components. Zstandard compression is on by default. By Almir Vuk

## Microsoft Releases .NET 11: C# 15 Union Types, Native AOT CLI Host, and CoreCLR by Default in MAUI

DevFeed: [Microsoft Releases .NET 11: C# 15 Union Types, Native AOT CLI Host, and CoreCLR by Default in MAUI](<https://devfeed.tech/articles/microsoft-releases-net-11-c-15-union-types-native-aot-cli-host-and-coreclr-by-default-in-maui-137153.md>)

Original publisher: [Read original article](<https://www.infoq.com/news/2026/11/dotnet-11-release/>)

Author: Almir Vuk

Published: 2026-11-17T11:50:00Z

Content type: news

Language: en

Sources: [InfoQ](<https://devfeed.tech/sources/infoq.md>)

Topics: [.NET](<https://devfeed.tech/topics/net.md>), [C#](<https://devfeed.tech/topics/csharp.md>), [union types](<https://devfeed.tech/topics/union-types.md>), [ASP.NET Core](<https://devfeed.tech/topics/asp-net-core.md>), [ASP.NET](<https://devfeed.tech/topics/aspnet.md>), [Closed hierarchies](<https://devfeed.tech/topics/closed-hierarchies.md>), [native aot](<https://devfeed.tech/topics/native-aot.md>), [.NET MAUI](<https://devfeed.tech/topics/net-maui.md>), [releases](<https://devfeed.tech/topics/releases.md>), [OpenAPI Specification](<https://devfeed.tech/topics/openapi.md>), [efcore](<https://devfeed.tech/topics/efcore.md>), [SignalR](<https://devfeed.tech/topics/signalr.md>)

Tags: [aot](<https://devfeed.tech/tags/aot.md>), [c-sharp](<https://devfeed.tech/tags/c-sharp.md>), [c-sharp-15](<https://devfeed.tech/tags/c-sharp-15.md>), [c-sharp-15-union-types](<https://devfeed.tech/tags/c-sharp-15-union-types.md>), [cli](<https://devfeed.tech/tags/cli.md>), [coreclr](<https://devfeed.tech/tags/coreclr.md>), [development](<https://devfeed.tech/tags/development.md>), [dotnet-11-release](<https://devfeed.tech/tags/dotnet-11-release.md>), [maui](<https://devfeed.tech/tags/maui.md>), [microsoft](<https://devfeed.tech/tags/microsoft.md>), [native](<https://devfeed.tech/tags/native.md>), [native-aot](<https://devfeed.tech/tags/native-aot.md>), [net](<https://devfeed.tech/tags/net.md>), [net-10](<https://devfeed.tech/tags/net-10.md>), [net-11](<https://devfeed.tech/tags/net-11.md>), [net-11-c-sharp](<https://devfeed.tech/tags/net-11-c-sharp.md>), [net-9](<https://devfeed.tech/tags/net-9.md>), [net-maui](<https://devfeed.tech/tags/net-maui.md>), [news](<https://devfeed.tech/tags/news.md>), [releases](<https://devfeed.tech/tags/releases.md>), [types](<https://devfeed.tech/tags/types.md>), [union](<https://devfeed.tech/tags/union.md>), [union-types](<https://devfeed.tech/tags/union-types.md>)

### AI overview

Microsoft's .NET 11 is an STS release supported for two years; .NET 10 remains the LTS option. C# 15 adds union types with compiler-checked exhaustive switch expressions and closed hierarchies, alongside collection expression arguments and extension indexers. The SDK uses a Native AOT CLI host by default and keeps the MSBuild server warm; Runtime Async remains preview-only and requires a feature flag. ASP.NET Core adds asynchronous validation and defaults to OpenAPI 3.2, a listed breaking change. MAUI switches its default runtime to CoreCLR, while Mono remains available and Native AOT is opt-in. EF Core 11 requires .NET 11 and adds experimental vector search for SQL Server. The release also raises minimum hardware requirements, including an x86-64-v2 baseline.

### Source excerpt

Microsoft has released .NET 11, a Standard Term Support release with two years of support. It ships C# 15 with union types and closed hierarchies, a Native AOT CLI host, a preview of Runtime Async, Zstandard compression, asynchronous validation and OpenAPI 3.2 in ASP.NET Core, CoreCLR as the default runtime in .NET MAUI, and EF Core 11 with experimental vector search. By Almir Vuk

## Precision in type system design (or the Option type as an anti-pattern)

DevFeed: [Precision in type system design (or the Option type as an anti-pattern)](<https://devfeed.tech/articles/precision-in-type-system-design-or-the-option-type-as-an-anti-pattern-139422.md>)

Original publisher: [Read original article](<https://dashbit.co/blog/precision-in-type-system-design>)

Author: José Valim

Published: 2026-11-17T00:00:00Z

Content type: article

Language: en

Sources: [Dashbit Blog](<https://devfeed.tech/sources/dashbit-blog.md>)

Topics: [Programming Languages / Compilers](<https://devfeed.tech/topics/programming-languages-compilers.md>), [union types](<https://devfeed.tech/topics/union-types.md>), [typesafety](<https://devfeed.tech/topics/typesafety.md>)

Tags: [2026](<https://devfeed.tech/tags/2026.md>), [agents](<https://devfeed.tech/tags/agents.md>), [ai](<https://devfeed.tech/tags/ai.md>), [api](<https://devfeed.tech/tags/api.md>), [arithmetic](<https://devfeed.tech/tags/arithmetic.md>), [array](<https://devfeed.tech/tags/array.md>), [arrays](<https://devfeed.tech/tags/arrays.md>), [article](<https://devfeed.tech/tags/article.md>), [binaries](<https://devfeed.tech/tags/binaries.md>), [boolean](<https://devfeed.tech/tags/boolean.md>), [bugs](<https://devfeed.tech/tags/bugs.md>), [code](<https://devfeed.tech/tags/code.md>), [coding-agents](<https://devfeed.tech/tags/coding-agents.md>), [collection](<https://devfeed.tech/tags/collection.md>), [design](<https://devfeed.tech/tags/design.md>), [elixir](<https://devfeed.tech/tags/elixir.md>), [option](<https://devfeed.tech/tags/option.md>), [precision](<https://devfeed.tech/tags/precision.md>), [simplicity](<https://devfeed.tech/tags/simplicity.md>), [type](<https://devfeed.tech/tags/type.md>), [type-system](<https://devfeed.tech/tags/type-system.md>)

### AI overview

The article argues that greater type precision can expose hidden runtime assumptions, while also making programs harder to prove, signatures more verbose, error messages harder to read, and type checking slower. Its Elixir examples show how distinguishing empty from non-empty lists lets `Enum.max_by` require a non-empty list and catches an unsafe refactor; however, proving that a list remains non-empty after dropping elements can still exceed the type system's capabilities. The author calls `Option`/`Maybe` results an anti-pattern for API and language designers when they compensate for behavior that could be guaranteed statically, while recognizing they remain appropriate for inherently uncertain operations such as file access. Types rule out some errors but do not make programs error-free, so runtime failures still need isolation. The article concludes that sound, decidable type systems will reject some valid programs, and that designers must balance precision with ergonomics and performance.

### Source excerpt

When fine-tuning a type system for precision, we often have to make trade-offs between simplicity and expressiveness in its design. The goal of this article is to explore these trade-offs.

## Branded Phone Type

DevFeed: [Branded Phone Type](<https://devfeed.tech/articles/branded-phone-type-122149.md>)

Original publisher: [Read original article](<https://glebbahmutov.com/blog/branded-phone-type/>)

Author: Gleb Bahmutov

Published: 2026-11-06T05:00:00Z

Content type: article

Language: en

Sources: [Gleb Bahmutov](<https://devfeed.tech/sources/gleb-bahmutov.md>)

Topics: [typesafety](<https://devfeed.tech/topics/typesafety.md>), [data type](<https://devfeed.tech/topics/data-type.md>), [union types](<https://devfeed.tech/topics/union-types.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>)

Tags: [000](<https://devfeed.tech/tags/000.md>), [2](<https://devfeed.tech/tags/2.md>), [3](<https://devfeed.tech/tags/3.md>), [blog](<https://devfeed.tech/tags/blog.md>), [blog-post](<https://devfeed.tech/tags/blog-post.md>), [cypress](<https://devfeed.tech/tags/cypress.md>), [phone](<https://devfeed.tech/tags/phone.md>), [process](<https://devfeed.tech/tags/process.md>), [repo](<https://devfeed.tech/tags/repo.md>), [test](<https://devfeed.tech/tags/test.md>), [testing](<https://devfeed.tech/tags/testing.md>), [type](<https://devfeed.tech/tags/type.md>), [typescript](<https://devfeed.tech/tags/typescript.md>)

### AI overview

The excerpt describes using TypeScript branded types to distinguish test and real phone numbers from ordinary strings. It defines test numbers as 10-digit strings starting with "000," and real numbers as 10-digit strings starting with neither "000" nor "555"; formatted numbers have a separate pattern. Assertion functions validate a string at runtime and let TypeScript treat it as the corresponding branded type, catching type mismatches statically while still allowing phone numbers to be used as strings. The excerpt mentions ambient `.d.ts` declarations for shared types and backend data validated on receipt.

### Source excerpt

In my previous blog post Branded Types I have shown a useful technique for repre

## Creating a Typescript union, while also having runtime access to the values

DevFeed: [Creating a Typescript union, while also having runtime access to the values](<https://devfeed.tech/articles/creating-a-typescript-union-while-also-having-runtime-access-to-the-values-106007.md>)

Original publisher: [Read original article](<https://www.jvt.me/posts/2026/10/28/typescript-const-array/>)

Author: Jamie Tanna

Published: 2026-10-28T12:17:12Z

Content type: article

Language: en

Sources: [Jamie Tanna](<https://devfeed.tech/sources/articles-on-jamie-tanna-software-engineer.md>)

Topics: [union types](<https://devfeed.tech/topics/union-types.md>), [data type](<https://devfeed.tech/topics/data-type.md>)

Tags: [blogumentation](<https://devfeed.tech/tags/blogumentation.md>), [documentation](<https://devfeed.tech/tags/documentation.md>), [example](<https://devfeed.tech/tags/example.md>), [forgejo](<https://devfeed.tech/tags/forgejo.md>), [function](<https://devfeed.tech/tags/function.md>), [git](<https://devfeed.tech/tags/git.md>), [github](<https://devfeed.tech/tags/github.md>), [gitlab](<https://devfeed.tech/tags/gitlab.md>), [hosting](<https://devfeed.tech/tags/hosting.md>), [important](<https://devfeed.tech/tags/important.md>), [parameter](<https://devfeed.tech/tags/parameter.md>), [pattern](<https://devfeed.tech/tags/pattern.md>), [platform](<https://devfeed.tech/tags/platform.md>), [platforms](<https://devfeed.tech/tags/platforms.md>), [reference](<https://devfeed.tech/tags/reference.md>), [renovate](<https://devfeed.tech/tags/renovate.md>), [runtime](<https://devfeed.tech/tags/runtime.md>), [typescript](<https://devfeed.tech/tags/typescript.md>), [union](<https://devfeed.tech/tags/union.md>), [values](<https://devfeed.tech/tags/values.md>)

### AI overview

A TypeScript string union constrains values at compile time, but does not provide a runtime list to iterate over or use when generating documentation. The excerpt shows defining the values once in an array with `as const`, then deriving the union type as `(typeof Platforms)[number]`. This makes the values available at runtime while retaining the `Platform` type for function parameters. The example uses `github`, `gitlab` and `forgejo`; the excerpt does not elaborate on other approaches.

### Source excerpt

I very regularly end up writing this pattern - primarily in Renovate's code - so thought I'd write it up as a form of blogumentation, so I can refer back to it in the future. (This example uses concepts from the Renovate codebase, but does not take any code from it) For instance, let's say that you have a known union of big Git-hosting platforms - github, gitlab and forgejo. If you wanted to make sure that a given function parameter could only include them, you'd write i.e. export type Platform = 'github' | 'gitlab' | 'forgejo'; Normally this would be sufficient for usage, and nothing else is needed. But if you then want to be able to reference the ?? - for instance, as part of generating documentation - then you need some way of accessing each of these values at runtime. This leads us to: export const Platforms = [ 'github', 'gitlab', 'forgejo', // no shade to other platforms ] as const; // `as const` is important! export type Platform = (typeof Platforms)[number]; Now, you can access Platforms at runtime (and loop through them), while also enforcing the use of Platform as a function parameter.

## How to make postMessage type-safe in under 350 bytes

DevFeed: [How to make postMessage type-safe in under 350 bytes](<https://devfeed.tech/articles/how-to-make-postmessage-type-safe-in-under-350-bytes-105920.md>)

Original publisher: [Read original article](<https://evilmartians.com/chronicles/how-to-make-postmessage-type-safe-in-under-350-bytes>)

Author: Travis Turner (richardturner@evilmartians.com)

Published: 2026-10-28T00:00:00Z

Content type: article

Language: en

Sources: [Evil Martians](<https://devfeed.tech/sources/evil-martians.md>)

Topics: [Messaging](<https://devfeed.tech/topics/messaging.md>), [Publish-subscribe pattern](<https://devfeed.tech/topics/pubsub.md>), [union types](<https://devfeed.tech/topics/union-types.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [boilerplate](<https://devfeed.tech/tags/boilerplate.md>), [brotli](<https://devfeed.tech/tags/brotli.md>), [bus](<https://devfeed.tech/tags/bus.md>), [cancellation](<https://devfeed.tech/tags/cancellation.md>), [channel](<https://devfeed.tech/tags/channel.md>), [cleanup](<https://devfeed.tech/tags/cleanup.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [dx](<https://devfeed.tech/tags/dx.md>), [errors](<https://devfeed.tech/tags/errors.md>), [events](<https://devfeed.tech/tags/events.md>), [iframes](<https://devfeed.tech/tags/iframes.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [library](<https://devfeed.tech/tags/library.md>), [messages](<https://devfeed.tech/tags/messages.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [postmessage](<https://devfeed.tech/tags/postmessage.md>), [type-safe](<https://devfeed.tech/tags/type-safe.md>), [typescript](<https://devfeed.tech/tags/typescript.md>), [workers](<https://devfeed.tech/tags/workers.md>)

### AI overview

typed-channel gives TypeScript-checked message names and payloads across workers, iframes, tabs, and in-page event buses, using a shared channel API with interchangeable transports. Its `on` method returns an unsubscribe function; custom transports need only `on` and `emit`. The excerpt reports a 341-byte core with the `postMessage` transport and no dependencies. Version 0.11 adds optional RPC through `createTypedRpcChannel`: typed requests and handlers, propagated errors, and `AbortSignal` cancellation that stops handler work. Requests without a matching handler do not resolve on their own, so callers should provide a timeout signal when needed. Payloads and results are structured-cloned without library validation. `unlisten()` disconnects transports and rejects pending requests while aborting corresponding remote work. The RPC factory is about 1 kB; one-way messaging remains separate so projects pay for RPC only when used.

### Source excerpt

Typed-channel is a library for typed messages and requests across workers, iframes, tabs, and event buses.

## New in Symfony 8.2: Generics and Stricter Types in the Serializer

DevFeed: [New in Symfony 8.2: Generics and Stricter Types in the Serializer](<https://devfeed.tech/articles/new-in-symfony-8-2-generics-and-stricter-types-in-the-serializer-102321.md>)

Original publisher: [Read original article](<https://symfony.com/blog/new-in-symfony-8-2-generics-and-stricter-types-in-the-serializer>)

Author: Javier Eguiluz

Published: 2026-10-27T08:12:00Z

Content type: release

Language: en

Sources: [Symfony](<https://devfeed.tech/sources/symfony-blog.md>)

Topics: [Symfony](<https://devfeed.tech/topics/symfony.md>), [union types](<https://devfeed.tech/topics/union-types.md>), [Type Parameter](<https://devfeed.tech/topics/type-parameter.md>), [Programming Language Type Systems](<https://devfeed.tech/topics/programming-language-type-systems.md>), [Data validation](<https://devfeed.tech/topics/data-validation.md>), [typesafety](<https://devfeed.tech/topics/typesafety.md>)

Tags: [arrays](<https://devfeed.tech/tags/arrays.md>), [collections](<https://devfeed.tech/tags/collections.md>), [generics](<https://devfeed.tech/tags/generics.md>), [json](<https://devfeed.tech/tags/json.md>), [phpdoc](<https://devfeed.tech/tags/phpdoc.md>), [symfony](<https://devfeed.tech/tags/symfony.md>), [types](<https://devfeed.tech/tags/types.md>), [union-types](<https://devfeed.tech/tags/union-types.md>)

### AI overview

Symfony 8.2 improves Serializer denormalization by resolving PHPDoc generic types from the property that holds a generic object, so nested values such as `Page<Product>` items become `Product` instances. This requires PropertyInfo's `PhpStanExtractor` and `phpstan/phpdoc-parser`; the target class name alone does not supply template types. It also denormalizes union-typed collection elements and throws when an element matches no union member or a key violates its key type. A JSON object supplied for `list<string>` still works in 8.2 but triggers a deprecation and will throw `NotNormalizableValueException` in 9.0; use a JSON array for a list, or an array type that permits meaningful keys. TypeInfo adds covariant-template support, `Type::map()` for replacing nested types, and `Type::getMismatches()` for paths and expected/actual types. Because mismatch reporting does more work, call it after `accepts()` returns false.

### Source excerpt

The Serializer component relies on the TypeInfo component to know the type of each property it denormalizes. Symfony 8.2 makes both components understand more of the types you already write in your PHPDoc, such as generics and arrays of union types, and makes...

## Agent Graph Engineering, Part 3: Why Your WebSocket Clients Need Generated Types

DevFeed: [Agent Graph Engineering, Part 3: Why Your WebSocket Clients Need Generated Types](<https://devfeed.tech/articles/agent-graph-engineering-part-3-why-your-websocket-clients-need-generated-types-95272.md>)

Original publisher: [Read original article](<https://hackernoon.com/agent-graph-engineering-part-3-why-your-websocket-clients-need-generated-types?source=rss>)

Author: Huy Nguyen

Published: 2026-10-22T08:21:23Z

Content type: article

Language: en

Sources: [HackerNoon](<https://devfeed.tech/sources/hackernoon.md>)

Topics: [WebSocket](<https://devfeed.tech/topics/websocket.md>), [union types](<https://devfeed.tech/topics/union-types.md>)

Tags: [agent](<https://devfeed.tech/tags/agent.md>), [ai-agent](<https://devfeed.tech/tags/ai-agent.md>), [ai-agent-safety](<https://devfeed.tech/tags/ai-agent-safety.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [backend-development](<https://devfeed.tech/tags/backend-development.md>), [cross-language-types](<https://devfeed.tech/tags/cross-language-types.md>), [graph](<https://devfeed.tech/tags/graph.md>), [python](<https://devfeed.tech/tags/python.md>), [services](<https://devfeed.tech/tags/services.md>), [types](<https://devfeed.tech/tags/types.md>), [typescript](<https://devfeed.tech/tags/typescript.md>), [websocket](<https://devfeed.tech/tags/websocket.md>)

### AI overview

The article argues that when services cross process or language boundaries, declare data shapes on the server and generate clients and interfaces from those contracts. OpenAPI supplies a typed REST client; AsyncAPI carries WebSocket event types and directionality into TypeScript, so adding or removing an event updates the generated union and can expose stale frontend handling at compile time. Tool argument schemas can also drive approval forms, validation, and defaults, helping ensure reviewers see the fields the server accepts. The approach adds build and regeneration steps, may require a live schema endpoint, and inherits generator choices; the article says it brings little value for one service in one language or throwaway prototypes, while public APIs still need versioning.

### Source excerpt

Three services in two languages means three seams, and a hand-maintained seam is a slow leak.

## C# 15 Union Types for API Results: Examples, Trade-Offs, and Migration

DevFeed: [C# 15 Union Types for API Results: Examples, Trade-Offs, and Migration](<https://devfeed.tech/articles/c-15-union-types-for-api-results-examples-trade-offs-and-migration-92884.md>)

Original publisher: [Read original article](<https://www.syncfusion.com/blogs/post/csharp-15-union-types-api-results>)

Author: Arunachalam Kandasamy Raja

Published: 2026-10-21T14:17:46Z

Content type: article

Language: en

Sources: [Syncfusion](<https://devfeed.tech/sources/syncfusion-blogs.md>)

Topics: [union types](<https://devfeed.tech/topics/union-types.md>), [ASP.NET](<https://devfeed.tech/topics/aspnet.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [asp-net-core](<https://devfeed.tech/tags/asp-net-core.md>), [business](<https://devfeed.tech/tags/business.md>), [c-sharp](<https://devfeed.tech/tags/c-sharp.md>), [c-sharp-15](<https://devfeed.tech/tags/c-sharp-15.md>), [c-sharp-15-union-types](<https://devfeed.tech/tags/c-sharp-15-union-types.md>), [c-sharp-discriminated-unions](<https://devfeed.tech/tags/c-sharp-discriminated-unions.md>), [c-sharp-result-pattern](<https://devfeed.tech/tags/c-sharp-result-pattern.md>), [c-sharp-union-types](<https://devfeed.tech/tags/c-sharp-union-types.md>), [c-sharp-union-types-in-asp-net-core](<https://devfeed.tech/tags/c-sharp-union-types-in-asp-net-core.md>), [cases](<https://devfeed.tech/tags/cases.md>), [compare](<https://devfeed.tech/tags/compare.md>), [compatibility](<https://devfeed.tech/tags/compatibility.md>), [compilation](<https://devfeed.tech/tags/compilation.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [examples](<https://devfeed.tech/tags/examples.md>), [microsoft](<https://devfeed.tech/tags/microsoft.md>), [migration](<https://devfeed.tech/tags/migration.md>), [net-11](<https://devfeed.tech/tags/net-11.md>), [net-development](<https://devfeed.tech/tags/net-development.md>), [net-development-asp-net-core-c-sharp-software-architecture-web-platform-apis-what-s-new](<https://devfeed.tech/tags/net-development-asp-net-core-c-sharp-software-architecture-web-platform-apis-what-s-new.md>), [net-sdk](<https://devfeed.tech/tags/net-sdk.md>), [results](<https://devfeed.tech/tags/results.md>), [software-architecture](<https://devfeed.tech/tags/software-architecture.md>), [software-development](<https://devfeed.tech/tags/software-development.md>), [types](<https://devfeed.tech/tags/types.md>), [union](<https://devfeed.tech/tags/union.md>), [union-types](<https://devfeed.tech/tags/union-types.md>), [web-api](<https://devfeed.tech/tags/web-api.md>), [web-platform-apis](<https://devfeed.tech/tags/web-platform-apis.md>), [what-s-new](<https://devfeed.tech/tags/what-s-new.md>)

### AI overview

C# 15 union types represent a fixed set of result cases and let the compiler flag unhandled cases in switch expressions. In the ASP.NET Core example, a service returns distinct order outcomes while a controller maps them to HTTP responses, keeping business logic separate from HTTP handling. Unions suit closed sets of expected outcomes; interfaces better fit extensible implementations, and an established Result<T> may already meet a project's needs. Generated unions store cases through object?, so value types may box; the text recommends measuring performance-sensitive use. JSON deserialization can be ambiguous when structural case shapes overlap, and explicit polymorphic serialization may suit APIs needing a stable discriminator. Because unions are preview features in the C# 15/.NET 11 development cycle, migration guidance is to update internal consumers first and check response contracts, OpenAPI, generated clients, and serialized or persisted data before removing an old result model.

### Source excerpt

Learn how C# 15 union types simplify ASP.NET Core API results, compare with existing C# patterns, and help you decide when to adopt them.

## PEP 827: Type Manipulation (Python Language Summit 2026)

DevFeed: [PEP 827: Type Manipulation (Python Language Summit 2026)](<https://devfeed.tech/articles/pep-827-type-manipulation-python-language-summit-2026-62422.md>)

Original publisher: [Read original article](<https://blog.python.org/2026/09/language-summit-2026-pep-827-type-manipulation/>)

Author: Seth Larson

Published: 2026-09-30T12:00:09Z

Content type: article

Language: en

Sources: [Python Insider](<https://devfeed.tech/sources/python-insider.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [data type](<https://devfeed.tech/topics/data-type.md>), [union types](<https://devfeed.tech/topics/union-types.md>), [T3 Stack](<https://devfeed.tech/topics/t3-stack.md>), [Prisma](<https://devfeed.tech/topics/prisma.md>)

Tags: [2026](<https://devfeed.tech/tags/2026.md>), [database](<https://devfeed.tech/tags/database.md>), [http](<https://devfeed.tech/tags/http.md>), [idea](<https://devfeed.tech/tags/idea.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [language](<https://devfeed.tech/tags/language.md>), [language-summit](<https://devfeed.tech/tags/language-summit.md>), [language-summit-2026](<https://devfeed.tech/tags/language-summit-2026.md>), [programming-language](<https://devfeed.tech/tags/programming-language.md>), [type](<https://devfeed.tech/tags/type.md>), [types](<https://devfeed.tech/tags/types.md>), [typescript](<https://devfeed.tech/tags/typescript.md>)

### AI overview

Michael J. Sullivan presented PEP 827 at the Python Language Summit, focusing on how Python type annotations are stored. The proposal describes type manipulation features, including conditional and comprehension types, intended to support inferred return types and programmatically transformed model types for CRUD applications.

### Source excerpt

Michael J. Sullivan presents PEP 827 and discusses a key design decision: how to store type annotations?

## Jev argues for RLCD models to produce structured values for software

DevFeed: [Jev argues for RLCD models to produce structured values for software](<https://devfeed.tech/articles/jev-find-out-why-rlcd-and-system-one-models-are-rewriting-ai-architecture-62603.md>)

Original publisher: [Read original article](<https://hackernoon.com/jev-find-out-why-rlcd-and-system-one-models-are-rewriting-ai-architecture?source=rss>)

Author: ProgrammingCentral

Published: 2026-09-30T00:58:52Z

Content type: opinion

Language: en

Sources: [HackerNoon](<https://devfeed.tech/sources/hackernoon.md>)

Topics: [AI Models](<https://devfeed.tech/topics/ai-models.md>), [grpo](<https://devfeed.tech/topics/grpo.md>), [Large Language Model](<https://devfeed.tech/topics/llm.md>), [llm-reasoning](<https://devfeed.tech/topics/llm-reasoning.md>), [union types](<https://devfeed.tech/topics/union-types.md>), [World models](<https://devfeed.tech/topics/world-models.md>), [Handlebars](<https://devfeed.tech/topics/handlebars.md>), [human review](<https://devfeed.tech/topics/human-review.md>), [rlhf](<https://devfeed.tech/topics/rlhf.md>), [monolithic-architecture](<https://devfeed.tech/topics/monolithic-architecture.md>), [engineering-leadership](<https://devfeed.tech/topics/engineering-leadership.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [ai-architecture](<https://devfeed.tech/tags/ai-architecture.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [code](<https://devfeed.tech/tags/code.md>), [enums](<https://devfeed.tech/tags/enums.md>), [functions](<https://devfeed.tech/tags/functions.md>), [generation](<https://devfeed.tech/tags/generation.md>), [generative](<https://devfeed.tech/tags/generative.md>), [it](<https://devfeed.tech/tags/it.md>), [jev](<https://devfeed.tech/tags/jev.md>), [json](<https://devfeed.tech/tags/json.md>), [kind](<https://devfeed.tech/tags/kind.md>), [language](<https://devfeed.tech/tags/language.md>), [language-model](<https://devfeed.tech/tags/language-model.md>), [language-models](<https://devfeed.tech/tags/language-models.md>), [large-language-model](<https://devfeed.tech/tags/large-language-model.md>), [learning](<https://devfeed.tech/tags/learning.md>), [llm](<https://devfeed.tech/tags/llm.md>), [llms](<https://devfeed.tech/tags/llms.md>), [reinforcement-learning](<https://devfeed.tech/tags/reinforcement-learning.md>), [reinforcement-learning-for-calibrated-decisions](<https://devfeed.tech/tags/reinforcement-learning-for-calibrated-decisions.md>), [rlcd](<https://devfeed.tech/tags/rlcd.md>), [system-one-models](<https://devfeed.tech/tags/system-one-models.md>), [typesafe-jev](<https://devfeed.tech/tags/typesafe-jev.md>), [typescript](<https://devfeed.tech/tags/typescript.md>)

### AI overview

The article argues that software teams incur engineering costs when they make large language models return structured values through parsing, validation, retries, and output repair. It presents Jev's System One models, trained with Reinforcement Learning for Calibrated Decisions (RLCD), as an alternative that produces values for software directly instead of defaulting to text generation.

### Source excerpt

By introducing System One models trained via Reinforcement Learning for Calibrated Decisions (RLCD), Jev marks the end of text generation as the default output

## Quiz: Python 3.15 Preview: Sentinel Values

DevFeed: [Quiz: Python 3.15 Preview: Sentinel Values](<https://devfeed.tech/articles/quiz-python-3-15-preview-sentinel-values-61637.md>)

Original publisher: [Read original article](<https://realpython.com/quizzes/python315-sentinel-values/>)

Author: Real Python

Published: 2026-09-28T12:00:00Z

Content type: tutorial

Language: en

Sources: [Real Python](<https://devfeed.tech/sources/real-python.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [data type](<https://devfeed.tech/topics/data-type.md>), [type coercion](<https://devfeed.tech/topics/type-coercion.md>), [union types](<https://devfeed.tech/topics/union-types.md>)

Tags: [built-in](<https://devfeed.tech/tags/built-in.md>), [code](<https://devfeed.tech/tags/code.md>), [hints](<https://devfeed.tech/tags/hints.md>), [identity](<https://devfeed.tech/tags/identity.md>), [interactive](<https://devfeed.tech/tags/interactive.md>), [preview](<https://devfeed.tech/tags/preview.md>), [python](<https://devfeed.tech/tags/python.md>), [questions](<https://devfeed.tech/tags/questions.md>), [score](<https://devfeed.tech/tags/score.md>), [test](<https://devfeed.tech/tags/test.md>), [time](<https://devfeed.tech/tags/time.md>), [type](<https://devfeed.tech/tags/type.md>), [upgrade](<https://devfeed.tech/tags/upgrade.md>)

### AI overview

An interactive quiz tests knowledge of Python 3.15's sentinel values, including their use in signatures and type hints, identity through copying and pickling, and when to prefer a sentinel over another marker.

### Source excerpt

Test your grasp of Python 3.15's new sentinel built-in, from readable signatures and type hints to safe copying, pickling, and when to use one.

## The pain of serializing unions and closed class hierarchies with System.Text.Json: Exploring the .NET 11 preview - Part 7

DevFeed: [The pain of serializing unions and closed class hierarchies with System.Text.Json: Exploring the .NET 11 preview - Part 7](<https://devfeed.tech/articles/the-pain-of-serializing-unions-and-closed-class-hierarchies-with-system-text-json-exploring-the-net-11-preview-part-7-51479.md>)

Original publisher: [Read original article](<https://andrewlock.net/exploring-the-dotnet-11-preview-7-the-pain-of-serializing-unions-and-closed-class-hierarchies-with-system-text-json/>)

Author: Andrew Lock

Published: 2026-09-01T10:00:00Z

Content type: tutorial

Language: en

Sources: [Andrew Lock | .NET Escapades](<https://devfeed.tech/sources/andrew-lock-net-escapades.md>)

Topics: [.NET](<https://devfeed.tech/topics/net.md>), [system.text.json](<https://devfeed.tech/topics/system-text-json.md>), [C#](<https://devfeed.tech/topics/csharp.md>), [Closed hierarchies](<https://devfeed.tech/topics/closed-hierarchies.md>), [JSON](<https://devfeed.tech/topics/json.md>), [union types](<https://devfeed.tech/topics/union-types.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [c-sharp](<https://devfeed.tech/tags/c-sharp.md>), [c-sharp-15](<https://devfeed.tech/tags/c-sharp-15.md>), [closed-hierarchies](<https://devfeed.tech/tags/closed-hierarchies.md>), [json](<https://devfeed.tech/tags/json.md>), [net](<https://devfeed.tech/tags/net.md>), [net-11](<https://devfeed.tech/tags/net-11.md>), [net-11-c-sharp](<https://devfeed.tech/tags/net-11-c-sharp.md>), [net-11-preview-7](<https://devfeed.tech/tags/net-11-preview-7.md>), [preview](<https://devfeed.tech/tags/preview.md>), [rust](<https://devfeed.tech/tags/rust.md>), [system-text-json](<https://devfeed.tech/tags/system-text-json.md>)

### AI overview

This tutorial examines how System.Text.Json handles union types and closed class hierarchies introduced in .NET 11 and C# 15. It compares the two approaches, demonstrates serialization and deserialization, and documents errors and compatibility edge cases encountered in .NET 11 Preview 7.

### Source excerpt

In this post I discuss the System.Text.Json support for unions and closed hierarchies coming in .NET 11, the decisions made, and some of the sharp edges I hit

## Explore new features available in C# 15 preview

DevFeed: [Explore new features available in C# 15 preview](<https://devfeed.tech/articles/explore-new-features-available-in-c-15-preview-2949.md>)

Original publisher: [Read original article](<https://devblogs.microsoft.com/dotnet/explore-csharp-15/>)

Author: Bill Wagner

Published: 2026-08-24T17:00:00Z

Content type: article

Language: en

Sources: [.NET Blog](<https://devfeed.tech/sources/net-blog.md>)

Topics: [C#](<https://devfeed.tech/topics/csharp.md>), [.NET](<https://devfeed.tech/topics/net.md>), [union types](<https://devfeed.tech/topics/union-types.md>)

Tags: [blog](<https://devfeed.tech/tags/blog.md>), [c-sharp](<https://devfeed.tech/tags/c-sharp.md>), [c-sharp-15](<https://devfeed.tech/tags/c-sharp-15.md>), [closed-hierarchies](<https://devfeed.tech/tags/closed-hierarchies.md>), [dotnet](<https://devfeed.tech/tags/dotnet.md>), [features](<https://devfeed.tech/tags/features.md>), [net](<https://devfeed.tech/tags/net.md>), [net-11](<https://devfeed.tech/tags/net-11.md>), [net-11-preview-7](<https://devfeed.tech/tags/net-11-preview-7.md>), [union-types](<https://devfeed.tech/tags/union-types.md>)

### AI overview

An overview of the new features in C# 15, which ships with .NET 11. The article covers union types, closed hierarchies, the preview memory-safety redesign, and several smaller language changes.

### Source excerpt

C# 15 ships with .NET 11. It adds union types, closed hierarchies, a preview of the updated unsafe model, and a few smaller changes that remove everyday ceremony. The post Explore new features available in C# 15 preview appeared first on .NET Blog.

## This Month in Julia World (May and June 2026)

DevFeed: [This Month in Julia World (May and June 2026)](<https://devfeed.tech/articles/this-month-in-julia-world-may-and-june-2026-116340.md>)

Original publisher: [Read original article](<https://julialang.org/blog/2026/07/this-month-in-julia-world/index.html>)

Author: Jakob Nybo Andersen

Published: 2026-07-30T00:00:00Z

Content type: news

Language: en

Sources: [JuliaLang - The Julia programming language](<https://devfeed.tech/sources/julialang-the-julia-programming-language.md>)

Topics: [The Julia Language](<https://devfeed.tech/topics/julia.md>), [scheduling](<https://devfeed.tech/topics/scheduling.md>), [union types](<https://devfeed.tech/topics/union-types.md>)

Tags: [2](<https://devfeed.tech/tags/2.md>), [2026](<https://devfeed.tech/tags/2026.md>), [3](<https://devfeed.tech/tags/3.md>), [about](<https://devfeed.tech/tags/about.md>), [abstract](<https://devfeed.tech/tags/abstract.md>), [added](<https://devfeed.tech/tags/added.md>), [agent](<https://devfeed.tech/tags/agent.md>), [agents](<https://devfeed.tech/tags/agents.md>), [all](<https://devfeed.tech/tags/all.md>), [allows](<https://devfeed.tech/tags/allows.md>), [also](<https://devfeed.tech/tags/also.md>), [am](<https://devfeed.tech/tags/am.md>), [analysis](<https://devfeed.tech/tags/analysis.md>), [api](<https://devfeed.tech/tags/api.md>), [arguments](<https://devfeed.tech/tags/arguments.md>), [community](<https://devfeed.tech/tags/community.md>), [julia](<https://devfeed.tech/tags/julia.md>), [june](<https://devfeed.tech/tags/june.md>), [newsletter](<https://devfeed.tech/tags/newsletter.md>), [this](<https://devfeed.tech/tags/this.md>)

### AI overview

The May-June 2026 update reports work on Julia's compiler performance, runtime, filesystem APIs, diagnostics, and garbage collection. Precompile times had regressed since v1.10; ongoing changes target compiler optimization, while dynamic dispatch improvements are expected to help type-unstable code and concrete evaluation. Base now exports `DirEntry`, with `readdir` methods returning these filesystem entries, and a proposed lazy `scandir` can avoid querying every directory entry when searching for a specific file. Other work includes concurrent Immix GC support, more precise `MethodError` hints, byte-precise stacktrace experiments, and task-scheduling changes that reportedly yielded roughly 100x speedups on Windows for workloads spawning many tasks. A proposed replaceable, separately compiled frontend could let packages use newer syntax while supporting an older Julia version. Tiered compilation remains speculative; the excerpt says it is unclear how the proposal addresses a known risk involving long-running unoptimized loops. The newsletter also notes that Agents.jl and XGBoost.jl are seeking maintainers.

### Source excerpt

Community Newsletter for May and June 2026

## .NET (OK, C#) finally gets union types🎉: Exploring the .NET 11 preview - Part 2

DevFeed: [.NET (OK, C#) finally gets union types🎉: Exploring the .NET 11 preview - Part 2](<https://devfeed.tech/articles/net-ok-c-finally-gets-union-types-exploring-the-net-11-preview-part-2-51474.md>)

Original publisher: [Read original article](<https://andrewlock.net/exploring-the-dotnet-11-preview-2-dotnet-gets-union-types/>)

Author: Andrew Lock

Published: 2026-05-19T10:00:00Z

Content type: article

Language: en

Sources: [Andrew Lock | .NET Escapades](<https://devfeed.tech/sources/andrew-lock-net-escapades.md>)

Topics: [.NET](<https://devfeed.tech/topics/net.md>), [union types](<https://devfeed.tech/topics/union-types.md>), [C#](<https://devfeed.tech/topics/csharp.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Functional programming](<https://devfeed.tech/topics/functional-programming.md>)

Tags: [c-sharp](<https://devfeed.tech/tags/c-sharp.md>), [c-sharp-15](<https://devfeed.tech/tags/c-sharp-15.md>), [functional-programming](<https://devfeed.tech/tags/functional-programming.md>), [net](<https://devfeed.tech/tags/net.md>), [net-11](<https://devfeed.tech/tags/net-11.md>), [net-11-c-sharp](<https://devfeed.tech/tags/net-11-c-sharp.md>), [preview](<https://devfeed.tech/tags/preview.md>), [programming](<https://devfeed.tech/tags/programming.md>), [types](<https://devfeed.tech/tags/types.md>), [union-types](<https://devfeed.tech/tags/union-types.md>)

### AI overview

The post examines union types in C# 15 and .NET 11 preview, covering their purpose, implementation, usage, and custom type creation. It also explains how unions can represent values from several potentially unrelated types and relates them to the result pattern.

### Source excerpt

In this post I discuss the support for union types released in .NET 11, how they're implemented, the choices made, and how to create your own

## Deriving Type Erasure

DevFeed: [Deriving Type Erasure](<https://devfeed.tech/articles/deriving-type-erasure-60973.md>)

Original publisher: [Read original article](<https://david.alvarezrosa.com/posts/deriving-type-erasure/>)

Author: David Álvarez Rosa

Published: 2026-03-10T09:46:00Z

Content type: tutorial

Language: en

Sources: [David Álvarez Rosa](<https://devfeed.tech/sources/david-alvarez-rosa.md>)

Topics: [union types](<https://devfeed.tech/topics/union-types.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [cpp](<https://devfeed.tech/tags/cpp.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [polymorphism](<https://devfeed.tech/tags/polymorphism.md>), [subclass](<https://devfeed.tech/tags/subclass.md>), [types](<https://devfeed.tech/tags/types.md>)

### AI overview

The tutorial explains type erasure in C++ by comparing interface-based polymorphism with templates. It introduces wrappers that can provide a shared interface for concrete types that do not share a base class, deriving a minimal std::any implementation.

### Source excerpt

Ever looked at std::any and wondered what's going on behind the scenes? Beneath the intimidating interface is a classic technique called type erasure: concrete types hidden behind a small, uniform wrapper. Starting from familiar tools like virtual functions and templates, we'll build a minimal std::any. By the end, you'll have a clear understanding of how type erasure works under the hood. Polymorphism with interfaces § The typical way to achieve polymorphism is to define an interface consisting of pure-virtual methods you want to be able to call. Then, for each implementation that you want to use polymorphically, you create a subclass that inherits from the base class and implement those methods. As an example, let's implement shape classes that have an area() method. We start with an interface1 class class Shape { public: virtual ~Shape() = default; virtual auto area() const noexcept -> double = 0; }; And add a couple of concrete implementations for Square and Circle class Square : public Shape { int side_; public: explicit Square(int side) noexcept : side_{side} {} auto area() const noexcept -> double override { return side_ * side_; } }; class Circle : public Shape { int radius_; public: explicit Circle(int radius) noexcept : radius_{radius} {} auto area() const noexcept -> double override { return std::numbers::pi * radius_ * radius_; } }; Now, we can use these implementations generically, by coding against the interface auto printArea(const Shape& shape) -> void { std::println("Area is {:.2f}", shape.area()); } Simple enough, right? Polymorphism with templates § Inheritance is a good solution to problems that require polymorphism, but sometimes the concrete types you want to handle polymorphically cannot share a common base class.2 In that case, if the types provide the same interface, you can use a template to get polymorphism instead auto printArea(const auto& shape) -> void { std::println("Area is {:.2f}", shape.area()); } You can use this method with Squar

## KotlinConf 2025 Announcements

DevFeed: [KotlinConf 2025 Announcements](<https://devfeed.tech/articles/kotlinconf-2025-announcements-39349.md>)

Original publisher: [Read original article](<https://kt.academy/article/kotlinconf2025-announcements>)

Published: 2025-06-03T00:00:00Z

Content type: article

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [destructuring](<https://devfeed.tech/topics/destructuring.md>), [Exception](<https://devfeed.tech/topics/exception.md>), [union types](<https://devfeed.tech/topics/union-types.md>), [syntax](<https://devfeed.tech/topics/syntax.md>), [Safe-Call Operator](<https://devfeed.tech/topics/safe-call-operator.md>)

Tags: [announcements](<https://devfeed.tech/tags/announcements.md>), [destructuring](<https://devfeed.tech/tags/destructuring.md>), [exceptions](<https://devfeed.tech/tags/exceptions.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlinconf](<https://devfeed.tech/tags/kotlinconf.md>), [new-features](<https://devfeed.tech/tags/new-features.md>), [safe-call-operator](<https://devfeed.tech/tags/safe-call-operator.md>), [syntax](<https://devfeed.tech/tags/syntax.md>), [union-types](<https://devfeed.tech/tags/union-types.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

The article summarizes announcements from KotlinConf 2025, including K2 becoming stable, upcoming name-based destructuring, and rich errors with language-level support for result-or-error types and related operators.

### Source excerpt

The greatest announcements from KotlinConf 2025.

## TypeScript enums and falsy values

DevFeed: [TypeScript enums and falsy values](<https://devfeed.tech/articles/typescript-enums-and-falsy-values-52575.md>)

Original publisher: [Read original article](<http://www.jackfranklin.co.uk/blog/typescript-enums-0-values/>)

Published: 2024-11-17T00:00:00Z

Content type: article

Language: en

Sources: [Jack Franklin](<https://devfeed.tech/sources/jack-franklin.md>)

Topics: [TypeScript](<https://devfeed.tech/topics/typescript.md>), [enum](<https://devfeed.tech/topics/enum.md>), [union types](<https://devfeed.tech/topics/union-types.md>), [conditionals](<https://devfeed.tech/topics/conditionals.md>), [Null-Safety](<https://devfeed.tech/topics/null-safety.md>), [if statement](<https://devfeed.tech/topics/if-statement.md>)

Tags: [boolean](<https://devfeed.tech/tags/boolean.md>), [bug](<https://devfeed.tech/tags/bug.md>), [code](<https://devfeed.tech/tags/code.md>), [condition](<https://devfeed.tech/tags/condition.md>), [conditional](<https://devfeed.tech/tags/conditional.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [documentation](<https://devfeed.tech/tags/documentation.md>), [enum](<https://devfeed.tech/tags/enum.md>), [enums](<https://devfeed.tech/tags/enums.md>), [function](<https://devfeed.tech/tags/function.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [members](<https://devfeed.tech/tags/members.md>), [null](<https://devfeed.tech/tags/null.md>), [number](<https://devfeed.tech/tags/number.md>), [return](<https://devfeed.tech/tags/return.md>), [status](<https://devfeed.tech/tags/status.md>), [string](<https://devfeed.tech/tags/string.md>), [typescript](<https://devfeed.tech/tags/typescript.md>), [value](<https://devfeed.tech/tags/value.md>), [values](<https://devfeed.tech/tags/values.md>)

### AI overview

A numeric TypeScript enum starts at 0 by default, and JavaScript treats 0 as falsy. When a function returns an enum value or null, `if (status)` therefore mistakes the first enum member for "not logged in." The text recommends checking `status !== null`, or assigning enum members nonzero numeric values or nonempty strings so truthiness checks do not reject a valid status. It also notes that the issue can pass TypeScript compilation and mentions the TypeScript ESLint `strict-boolean-expressions` rule as a possible aid.

### Source excerpt

I recently lost an evening to debugging a subtle issue which highlights a potential pitfall in the interaction between TypeScript enums and "falsy" values in JavaScript. Let's look at a scenario that illustrates this problem: Spot the Bug Consider the following code where a function returns either an enum value or null depending on whether a user is logged in: const enum Status { Inactive, Active, Pending, } function getUserStatus(user?: User): Status | null { if (!user) { // No user is logged in. return null } return user.status() } function checkUserStatus(user?: User): void { const status = getUserStatus(userId) if (status) { console.log('User has a valid status:', status) } else { console.log('The user is not logged in.') } } What's the Issue? JavaScript has a concept of truthy and falsy values. In conditional statements, values that are considered falsy are treated as false. The list of falsy values in JavaScript include: false 0 "" (empty string) null undefined NaN This means that if(0) {} is always false in JavaScript. Now we can look at the default values assigned to enum members in TypeScript. As the TypeScript documentation states, when initializing enum values, the default values are numeric and start from 0. These two enums are equivalent: const enum Status { Inactive = 0, Active = 1, Pending = 2, } const enum Status { Inactive, Active, Pending, } This means that if an enum member is assigned the value 0, it will behave like false in any condition where truthiness is evaluated rather than explicitly checking for the null value. Solving with explicit checks To avoid this bug, explicitly check for null instead of relying on truthy checks: function checkUserStatus(user?: User): void { const status = getUserStatus(user) if (status !== null) { console.log('User has a valid status:', status) } else { console.log('The user is not logged in.') } } Solving with explicit enum values Alternatively, because each number in JavaScript that is not 0 is considered truth

## The problem of union types for type systems

DevFeed: [The problem of union types for type systems](<https://devfeed.tech/articles/the-problem-of-union-types-for-type-systems-39390.md>)

Original publisher: [Read original article](<https://kt.academy/article/union-types-into>)

Published: 2024-06-10T00:00:00Z

Content type: opinion

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [union types](<https://devfeed.tech/topics/union-types.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [subtype](<https://devfeed.tech/topics/subtype.md>), [generic programming](<https://devfeed.tech/topics/generic-programming.md>)

Tags: [generics](<https://devfeed.tech/tags/generics.md>), [inference](<https://devfeed.tech/tags/inference.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [programming](<https://devfeed.tech/tags/programming.md>), [programming-languages](<https://devfeed.tech/tags/programming-languages.md>), [smart-cast](<https://devfeed.tech/tags/smart-cast.md>), [static](<https://devfeed.tech/tags/static.md>), [subtype](<https://devfeed.tech/tags/subtype.md>), [type](<https://devfeed.tech/tags/type.md>), [types](<https://devfeed.tech/tags/types.md>), [union](<https://devfeed.tech/tags/union.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

This article explains why general union types are difficult to add to Kotlin and other statically typed systems. It discusses ambiguity in subtype relationships and generic type inference, including the claim that inference is NP-hard, then describes Kotlin's proposed limited use of union types for representing errors through rich errors.

### Source excerpt

Why union types are not such a good idea for static type systems.

## Exhaustive branch checks with TypeScript

DevFeed: [Exhaustive branch checks with TypeScript](<https://devfeed.tech/articles/exhaustive-branch-checks-with-typescript-52577.md>)

Original publisher: [Read original article](<http://www.jackfranklin.co.uk/blog/typescript-exhaustive-branches/>)

Published: 2024-03-04T00:00:00Z

Content type: tutorial

Language: en

Sources: [Jack Franklin](<https://devfeed.tech/sources/jack-franklin.md>)

Topics: [TypeScript](<https://devfeed.tech/topics/typescript.md>), [exhaustive matching](<https://devfeed.tech/topics/exhaustive-matching.md>), [union types](<https://devfeed.tech/topics/union-types.md>), [enum](<https://devfeed.tech/topics/enum.md>)

Tags: [argument](<https://devfeed.tech/tags/argument.md>), [branch](<https://devfeed.tech/tags/branch.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [enum](<https://devfeed.tech/tags/enum.md>), [error](<https://devfeed.tech/tags/error.md>), [exhaustive](<https://devfeed.tech/tags/exhaustive.md>), [function](<https://devfeed.tech/tags/function.md>), [parameter](<https://devfeed.tech/tags/parameter.md>), [switch](<https://devfeed.tech/tags/switch.md>), [type](<https://devfeed.tech/tags/type.md>), [typescript](<https://devfeed.tech/tags/typescript.md>), [union](<https://devfeed.tech/tags/union.md>)

### AI overview

When branching on a TypeScript union or enum, add a `default` branch that calls `ensureExhaustive(value)`, a helper accepting `never`. If the type later gains a value that the branches do not handle, TypeScript reports that the value is not assignable to `never` and identifies the missing variant. This can catch unhandled cases even in `void` functions, where a missing branch may otherwise produce no error. The excerpt says the same approach works with narrowed `if`/`else` branches. The helper throws at runtime if reached.

### Source excerpt

It's very common when working with TypeScript that you will have a type that declares a list of values, such as an enum or union type: enum SupportedColour1 { RED, YELLOW, BLUE, } type SupportedColour2 = 'RED' | 'YELLOW' | 'BLUE' And then you will often have functions that need to run differently or return different values based on what variant is passed in: function codeForColour1(colour: SupportedColour1): string { switch (colour) { case SupportedColour1.BLUE: return '#0000ff' case SupportedColour1.RED: return '#ff0000' case SupportedColour1.YELLOW: return '#ffff00' } } function codeForColour2(colour: SupportedColour2): string { switch (colour) { case 'BLUE': return '#0000ff' case 'RED': return '#ff0000' case 'YELLOW': return '#ffff00' } } Updating code when types change One thing that can catch you out is if the list of valid values in the type changes. Let's say we want to add GREEN as a value to our union type (I will drop the enum example for brevity, but the functionality for the sake of this post is equivalent): type SupportedColour2 = 'RED' | 'YELLOW' | 'BLUE' | 'GREEN' In this case we will now get an error in this function. TypeScript will realise that the function does not return anything in the case that GREEN is passed in, but the error is not very obvious: function codeForColour2(colour: SupportedColour2): string { switch (colour) { case 'BLUE': return '#0000ff' case 'RED': return '#ff0000' case 'YELLOW': return '#ffff00' } } Function lacks ending return statement and return type does not include 'undefined'. If the function did not return a value, TypeScript will not error and it would be easy to miss that we now have a branch (for GREEN) that is not dealt with: // This will not error in TypeScript, even though we are not // dealing with the GREEN case. function logForColour(colour: SupportedColour2): void { switch (colour) { case 'BLUE': console.log('User picked blue') case 'RED': console.log('User picked red') case 'YELLOW': console.log('User picked

## Type Hinting in Python

DevFeed: [Type Hinting in Python](<https://devfeed.tech/articles/type-hinting-in-python-83729.md>)

Original publisher: [Read original article](<https://dagster.io/blog/python-type-hinting>)

Author: Elliot Gunn

Published: 2023-08-11T00:00:00Z

Content type: tutorial

Language: en

Sources: [Dagster](<https://devfeed.tech/sources/dagster.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [data type](<https://devfeed.tech/topics/data-type.md>), [union types](<https://devfeed.tech/topics/union-types.md>), [data-engineering](<https://devfeed.tech/topics/data-engineering.md>)

Tags: [data-engineering](<https://devfeed.tech/tags/data-engineering.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [python](<https://devfeed.tech/tags/python.md>), [type](<https://devfeed.tech/tags/type.md>)

### AI overview

This tutorial explains Python type hints for variables, functions, classes, collections, and generics, along with static checking using Pyright. It describes how annotations can improve readability and help identify type errors before runtime, while noting that Python does not enforce hints at runtime.

### Source excerpt

In part VI of our Data Engineering with Python series, we explore type hinting functions and classes, and how type hints reduce errors.

## Ruff v0.0.283

DevFeed: [Ruff v0.0.283](<https://devfeed.tech/articles/ruff-v0-0-283-82892.md>)

Original publisher: [Read original article](<https://astral.sh/blog/ruff-v0.0.283>)

Author: zanie@astral.sh (Zanie Blue)

Published: 2023-08-08T00:00:00Z

Content type: release

Language: en

Sources: [Astral](<https://devfeed.tech/sources/astral.md>)

Topics: [Pydantic](<https://devfeed.tech/topics/pydantic.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>), [union types](<https://devfeed.tech/topics/union-types.md>)

Tags: [3](<https://devfeed.tech/tags/3.md>), [bug-fixes](<https://devfeed.tech/tags/bug-fixes.md>), [ruff](<https://devfeed.tech/tags/ruff.md>), [type](<https://devfeed.tech/tags/type.md>)

### AI overview

Ruff v0.0.283 adds parser support for Python 3.12's PEP 695 syntax, introduces a rule to convert type aliases to the new syntax, and enables selected flake8-pyi rules in regular Python files. The release also changes the default target Python version to 3.8 and includes additional type annotation and formatting checks.

### Source excerpt

Ruff supports PEP 695, type checking rules are applied to all files, a bunch of bug fixes, and more.

## This Month in Julia World (May 2023)

DevFeed: [This Month in Julia World (May 2023)](<https://devfeed.tech/articles/this-month-in-julia-world-may-2023-116323.md>)

Original publisher: [Read original article](<https://julialang.org/blog/2023/06/this-month-in-julia-world/index.html>)

Author: Stefan Krastanov

Published: 2023-05-30T00:00:00Z

Content type: news

Language: en

Sources: [JuliaLang - The Julia programming language](<https://devfeed.tech/sources/julialang-the-julia-programming-language.md>)

Topics: [The Julia Language](<https://devfeed.tech/topics/julia.md>), [union types](<https://devfeed.tech/topics/union-types.md>)

Tags: [2023](<https://devfeed.tech/tags/2023.md>), [array](<https://devfeed.tech/tags/array.md>), [async](<https://devfeed.tech/tags/async.md>), [better](<https://devfeed.tech/tags/better.md>), [block](<https://devfeed.tech/tags/block.md>), [buffer](<https://devfeed.tech/tags/buffer.md>), [building](<https://devfeed.tech/tags/building.md>), [but](<https://devfeed.tech/tags/but.md>), [cache](<https://devfeed.tech/tags/cache.md>), [caching](<https://devfeed.tech/tags/caching.md>), [call](<https://devfeed.tech/tags/call.md>), [call-to-action](<https://devfeed.tech/tags/call-to-action.md>), [can](<https://devfeed.tech/tags/can.md>), [collection](<https://devfeed.tech/tags/collection.md>), [community](<https://devfeed.tech/tags/community.md>), [completion](<https://devfeed.tech/tags/completion.md>), [julia](<https://devfeed.tech/tags/julia.md>), [newsletter](<https://devfeed.tech/tags/newsletter.md>), [this](<https://devfeed.tech/tags/this.md>), [world](<https://devfeed.tech/tags/world.md>)

### AI overview

The May 2023 newsletter excerpt highlights Julia work on faster garbage collection, smaller and relocatable precompile caches, a new parser aimed at clearer error messages, and simpler stack traces. It also notes a proposal to redesign the Array interface around a lower-level memory buffer, experiments with tiered JIT and profile-guided optimization, and efforts to improve documentation and the Graphs ecosystem. RustFFT.jl is described as an interesting example of using Rust inside Julia, though the author says it is not really better than FFTW. The list is the author's personal, biased and incomplete selection.

### Source excerpt

Community Newsletter for May 2023

[Next page](<https://devfeed.tech/topics/union-types.md?cursor=WyIyMDIzLTA1LTMwVDAwOjAwOjAwKzAwOjAwIiwgImQyOTg0NjcwLWYxMjEtNGMyYS1iYmUxLWMxODZhYzA1ZDc4YSJd>)