You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Self-referential union: union base + self-mapping + direct allOf child renders its own union inside itself (TS2456) #95
Discovered during review of #94 (pre-existing on e3d0555 — not a regression from the concrete-base fix; the old build fails the same shape with 3 errors instead of 2).
Problem
When a discriminator base is a union (oneOf/anyOf) and lists itself in its own mappingand has a direct allOf child, the base's own definition renders its union inline — which contains the base itself:
exporttypeCircle=(Circle|Square)&/* … */;// TS2456: 'Circle' implicitly has type 'any' — self-reference in its own initializer
Root cause sketch
In the same-family spine path, a self-mapped union base is registered as a member with isUnion: true; mapSameFamilySpineRef's inline fallback expands the union inline at the base's own definition site, producing a circular type alias (src/analyzer/schema-mapper.ts, inline fallback).
Possible directions
Emit the base's union-arm members by name at its own definition instead of inlining (named union members are declared independently).
Or detect the cycle and fall back to the bare union name / warn.
Activity