Nest disagreement's other-item switch in the fixed item's text arm

This commit is contained in:
2026-09-30 20:57:48 +02:00
committed by Lillem4n
parent 57f4863107
commit 4ed4b10fa2
+3 -1
View File
@@ -183,7 +183,7 @@ func disagreement(a *template, da DataType, b *template, db DataType) error {
return fmt.Errorf("%s, so %s", held, typedAs(fix, want))
}
return fmt.Errorf("%s, so to read %q as text, %s", held, fix.format, asText(fix))
}
case kindText:
switch kindOf(other) {
case kindText:
panic(internalError("two text items hold one datatype, so they never disagree"))
@@ -197,6 +197,8 @@ func disagreement(a *template, da DataType, b *template, db DataType) error {
}
return fmt.Errorf(`item %q declares no datatype beside one holding %s; a column holds one, so give it "datatype": %q`, fix.format, want, want)
}
panic(internalError("disagreement has no case for item kind %d", kindOf(fix)))
}
// typedAs names the spelling giving a column-read item datatype d, keeping the other keys an object
// item carries.