From c304dae30371240cf49e73088d80db73024cd578 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Tue, 29 Sep 2026 03:51:44 +0200 Subject: [PATCH] Panic through internalError on a disagreement key with no fix --- datatype.go | 10 +++++++++- todo.md | 2 -- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/datatype.go b/datatype.go index ba5c678..f6d8b64 100644 --- a/datatype.go +++ b/datatype.go @@ -198,7 +198,15 @@ func disagreement(a *template, da DataType, b *template, db DataType) error { d.fix, d.other, d.want = b, a, da } proven := (&valueProof{}).proveColumnItem(d.fix).not[d.want] == "" - return disagreements[disagreementKey{kindOf(d.fix), kindOf(d.other), proven}](d) + return disagreementFix(disagreementKey{kindOf(d.fix), kindOf(d.other), proven})(d) +} + +func disagreementFix(k disagreementKey) func(d itemPair) error { + fix, ok := disagreements[k] + if !ok { + panic(internalError("no disagreement names the fix for %+v", k)) + } + return fix } func holdOne(d itemPair) error { diff --git a/todo.md b/todo.md index 9540234..e53919f 100644 --- a/todo.md +++ b/todo.md @@ -26,8 +26,6 @@ least modify. This round, in order: -- Test that `disagreements` holds every key `disagreement` can build, and panic through - `internalError` on a miss: a missing key is a nil func call today. - Name `printedNumber`'s `dp` cases, and say on `builtin` what `prints` and `proveNumber` a new builtin sets: the extender copied `digits` by analogy. - Rename the names that mislead: `table.pinnedRow` is the row node, not a pinned row;