/** Slice 4 — `union kind=result|option` validator. * * Spec: docs/language/result-option-spec.md * * Walks every `union` node and rejects: * 1. `kind=` — only `result` and `option` are recognised in slice 4. * Empty string and ExprObject `kind={{ ... }}` also error per the * slice 6 effects pattern (the prop is a literal-only string). * 2. `kind=result` shape — the union must declare exactly two variants * named `ok` and `err` (either order). Any other variant set is a * `KIND_SHAPE_VIOLATION`. * 3. `kind=option` shape — exactly two variants named `some` and `none`. * 4. `discriminant != 'kind'` on `kind=result|option` — the spec mandates * `discriminant=kind` so slice 7's `?` / `!` propagation operators can * check `r.kind === 'err'` uniformly across targets. * * These rules are what make the slice 4 stdlib helpers safe — `map`, * `unwrapOr`, etc. assume `x.kind === 'ok'` / `x.value` / `x.error`. The * schema enforces the shape so the helpers don't need defensive checks. * * Does NOT change codegen — unions that pass the walker emit unchanged. */ import type { ParseState } from './parser-diagnostics.js'; import { type IRNode } from './types.js'; export declare function validateUnionKind(state: ParseState, root: IRNode): void;