Panic through internalError on a disagreement key with no fix
This commit is contained in:
+9
-1
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user