Skip to content

UnionArms

module UnionArms
AssemblyXantham.Generator

Tier 3 - Shape: expand-union-arms, the deferred half of D4 (§4.5). A member whose parameter is an erased union gains one overload per arm, beside the union member rather than instead of it, so a value already held at union type still passes.

Runs after order-declarations, which is the earliest point an export is an FsExports container with the name its findings are reported under; before that the exports are a flat ExportMembers list with no container name to key on.

Runs after dedupe-overloads, which is the opposite of the intuitive order and deliberate: expanding first would have dedupe absorb synthesized arms and report DO001 for them, conflating "TypeScript declared overloads F# cannot separate" with "this pass invented a clashing signature". Expanding second leaves the collision check here, against a settled signature set.

Disabled by default. Arm overloads make f(!^ x) ambiguous (FS0041) at every existing call site, so enabling it is a consumer's migration to opt into.

Functions and values

expandUnionArms: Pass<ShapeModel>