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
You can reduce a union of two structures, neither of which is a subtype of the other, iff there exists some key K such that K is present in both structures and such that the set of entries other than K is identical for both structures, both in terms of keys and values.
This would allow the following types to reduce to equivalent:
Also if you think about how 1<number<10|10<=number<100 works, it is the only case I can think of where despite the two branches being disjoint, they can be reduced when unioned. Perhaps this could be handled with the same underlying logic?
Activity
[-]Collpase common parts of union[/-][+]Collapse common parts of union[/+]feat(sets): merge unions of connected ranges
feat(sets): merge unions of objects alike but for one key
Merge branch 'lane/not-equal' into lane/union-errors
docs: cite #925 and #751 inline, and say which errors a union's messa…
docs: correct claims the release's changes left stale
fix(sets): merge union branches only when their meta agrees
ssalbdivad commentedon Nov 18, 2026
Fixed in 3.0.0-beta.0 (#1728). Try it with
npm i arktype@next.