On this page

0035. Diagnose duplicate bounds and preserve interface root causes

Context

CP-4.3 review found redundant bounds accepted silently, failed inference leaking <error> into impl suggestions, and coherence discarding earlier type errors. ADR-0027's collection order remains necessary for reliable static dispatch.

Decision

Reject a repeated interface bound on the same parameter with E0611, at the later bound, with help to remove the duplicate. This extends the final M4 code table within its assigned E0600–E0649 generic range, as requested by review; E0609 keeps its existing meaning of a repeated type parameter.

Keep all diagnostics collected before a coherence conflict and sort by span. Still stop before impl signatures on E0650, and before bodies on invalid impl signatures/completeness, documenting that order in diagnostics.md. Any type containing an error satisfies bounds during recovery. Unknown qualified methods use E0653 even without a receiver argument; arity applies only to known methods.

Alternatives considered

Consequences

Repairs expose independent root causes in one run without placeholder types or invented arities. Duplicate-bound programs now fail; valid program semantics, dispatch and emitted code are unchanged. JSON/human goldens pin each behavior.