/** * Narrowed runtime union member resolution. * * Resolves the reachable runtime union members for a named binding, accounting * for any active narrowing state (runtimeSubset bindings). This is the semantic * analysis payload that guard detection and condition-branch narrowing need: * members, their slot numbers, and the original union arity. * * Uses getCanonicalRuntimeUnionMembers (semantic member resolution) instead of * buildRuntimeUnionFrame (runtime frame construction) to discover members from * type information. Runtime frame/layout construction should only happen at * lowering/materialization boundaries. */ import type { IrType } from "@tsonic/frontend"; import type { EmitterContext } from "../../types.js"; /** * The semantic payload for narrowed union member resolution. * * - members: the reachable IrType members (filtered by narrowing if active) * - candidateMemberNs: the 1-based slot numbers corresponding to each member * - runtimeUnionArity: the total arity of the original (un-narrowed) union */ export type NarrowedUnionMembers = { readonly members: readonly IrType[]; readonly candidateMemberNs: readonly number[]; readonly runtimeUnionArity: number; }; /** * Resolve the reachable runtime union members for a named binding. * * 1. If the binding has a pre-cached runtimeSubset with source members and * candidate slot numbers, filters those by the allowed runtimeMemberNs. * 2. Otherwise, resolves canonical members from the type via * getCanonicalRuntimeUnionMembers, then applies runtimeSubset filtering * if the binding is a narrowed runtimeSubset. * * Returns undefined if the type is not a runtime union or if narrowing * eliminates all members. */ export declare const resolveNarrowedUnionMembers: (originalName: string, unionSourceType: IrType, context: EmitterContext) => NarrowedUnionMembers | undefined; export declare const resolveAlignedRuntimeUnionMembers: (originalName: string | undefined, effectiveType: IrType | undefined, carrierSourceType: IrType | undefined, context: EmitterContext) => NarrowedUnionMembers | undefined; //# sourceMappingURL=narrowed-union-resolution.d.ts.map