Refuse only a datatype restating the column read, name the text spelling for datatypes taken from column reads keeping an item's other keys, and keep the fence Decision true
Tests / vet + fmt + tests (pull_request) Successful in 1m3s

This commit is contained in:
2026-09-15 21:28:52 +02:00
parent c991f35f4f
commit 72fe01e89b
4 changed files with 37 additions and 15 deletions
+2 -2
View File
@@ -26,13 +26,13 @@ type valueProof struct {
}
// checkDatatype rejects a typed column item some render of which is not text of its datatype,
// and one declaring a datatype over the typed column it is.
// and one restating the datatype of the column it is.
func (p *valueProof) checkDatatype(path string, n node) error {
t, ok := n.(*template)
if !ok || t.datatype == DataTypeString {
return nil
}
if d := readDatatype(t); d != DataTypeString {
if d := readDatatype(t); d == t.datatype {
return fmt.Errorf(`%s: %s takes datatype %s from the column it reads; drop "datatype"`, path, t.format, d)
}
if reason := p.columnItem(t).not[t.datatype]; reason != "" {