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
Better output for Tagged Variants with non-inline record #8280
Inline records in Variant provide good JS output, which is especially useful for bindings. When combined with tagged variants, they also provide a better DX.
However, it’s not always possible to inline records (or spread them in the case of recursive types), so I’m wondering if it would be possible to improve the JS output in the case of tagged variants.
One possible constraint would be to verify that the tag does not conflict with any of the record fields. We could also keep the same constraint as inline records: only one record.
Activity
[-]Better output for Tagged Variants[/-][+]Better output for Tagged Variants with non-inline record[/+]fhammerschmidt commentedon Mar 10, 2026
@cristianoc codex told me this is feasible, but what's your opinion?
cristianoc commentedon Mar 10, 2026
Construction and deconstruction
Element(x)is not so clear. It would need to perhaps make copy, perhaps breaking identity.cometkim commentedon Jul 16, 2026
See also the earlier discussion: #6547 (comment)