union_ambiguous
A name is registered by two cross-ref alternatives of one union, so declaration order decides which.
A warning, not an error. The document validates and the union’s rule is unchanged: alternatives are tried in declaration order and the first one that accepts wins. What this reports is that a second reading exists.
Given a union of two reference kinds:
(value-kind :name pipeline-ref :underlying union :union (union-shape :alternatives [render-pipeline-ref compute-pipeline-ref]))a document that names both a (render-pipeline :name same) and a
(compute-pipeline :name same) makes (dispatch :pipeline same)
resolvable two ways. Neither declaration is a duplicate,
duplicate detection is per-target, and these are different targets
so nothing else complains.
Why that is worth a warning: SJON picks by alternative order, and a consumer that resolves the same reference through its own table may well pick by something else. Two mechanisms, two answers, and the disagreement is silent. Order is doing work the author never chose.
Two repairs. Rename one of the declarations, which is right when the collision was an accident. Or split the slot into two keys with one reference kind each, which is right when both entities legitimately keep the name and the slot was overloaded.
It stays quiet in the cases where order is the design. A union
like [byte-count symbol] overlaps on purpose and names no
entity, so nothing warns. Nor does a union whose winning
alternative is a plain member set, the slot then denotes a
member, not a reference. Only two references to differently-named
entities trip it.
Run sjon explain union_ambiguous to read this at a terminal, browse every code, or work through diagnostics-driven repair if you want the habit rather than the answer.