Pick disagreement's fix through itemKind.declaresLess
This commit is contained in:
+6
-1
@@ -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.
|
// 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
|
type itemKind int
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -156,6 +157,10 @@ const (
|
|||||||
kindDeclares
|
kindDeclares
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func (k itemKind) declaresLess(than itemKind) bool {
|
||||||
|
return k < than
|
||||||
|
}
|
||||||
|
|
||||||
func kindOf(t *template) itemKind {
|
func kindOf(t *template) itemKind {
|
||||||
switch {
|
switch {
|
||||||
case t.datatype != DataTypeString:
|
case t.datatype != DataTypeString:
|
||||||
@@ -178,7 +183,7 @@ type itemPair struct {
|
|||||||
// the one that declares least, a when both declare alike.
|
// the one that declares least, a when both declare alike.
|
||||||
func disagreement(a *template, da DataType, b *template, db DataType) error {
|
func disagreement(a *template, da DataType, b *template, db DataType) error {
|
||||||
d := itemPair{first: da, second: db, fix: a, other: b, want: db}
|
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
|
d.fix, d.other, d.want = b, a, da
|
||||||
}
|
}
|
||||||
proven := (&valueProof{}).proveColumnItem(d.fix).not[d.want] == ""
|
proven := (&valueProof{}).proveColumnItem(d.fix).not[d.want] == ""
|
||||||
|
|||||||
@@ -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:
|
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
|
- 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.
|
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
|
- Rename `ftoken` to `scanUnit`, beside `formatToken`, and `session` to
|
||||||
|
|||||||
Reference in New Issue
Block a user