diff --git a/datatype.go b/datatype.go index 9930975..f04ce26 100644 --- a/datatype.go +++ b/datatype.go @@ -148,6 +148,7 @@ func columnItems(n node) (items []*template, nullable bool) { } // itemKind is how a column item comes by its datatype: none, read from a typed column, or declared. +// The kinds are declared from the one that declares least. type itemKind int const ( @@ -156,6 +157,10 @@ const ( kindDeclares ) +func (k itemKind) declaresLess(than itemKind) bool { + return k < than +} + func kindOf(t *template) itemKind { switch { case t.datatype != DataTypeString: @@ -178,7 +183,7 @@ type itemPair struct { // the one that declares least, a when both declare alike. func disagreement(a *template, da DataType, b *template, db DataType) error { d := itemPair{first: da, second: db, fix: a, other: b, want: db} - if kindOf(b) < kindOf(a) { + if kindOf(b).declaresLess(kindOf(a)) { d.fix, d.other, d.want = b, a, da } proven := (&valueProof{}).proveColumnItem(d.fix).not[d.want] == "" diff --git a/todo.md b/todo.md index f27cfca..84fa028 100644 --- a/todo.md +++ b/todo.md @@ -31,8 +31,6 @@ on 2026-09-29 a third time (Navigation 7.0, Locality 5.6, Shape 6.3, Self-suffic This round, in order: -- Pick `disagreement`'s fix through a named `itemKind` comparison: six seats could not - see that the kinds' declaration order is the rule. - Give `tableSite` one test for a cell, and have `traceRead` report no row outside a table: the zero value reads as row 0, a real cell, so each reader tests `table` first. - Rename `ftoken` to `scanUnit`, beside `formatToken`, and `session` to