Take the datatype and null of the column a lone reference reads, and check a column's datatypes once its references are linked
Tests / vet + fmt + tests (pull_request) Successful in 1m3s

This commit is contained in:
2026-09-15 20:20:25 +02:00
parent 802f62a4de
commit 2b2010bdd6
10 changed files with 159 additions and 57 deletions
+12 -3
View File
@@ -253,11 +253,20 @@ func checkNoRepeatedRead(format string, c formatOps, refs map[string]refBinding)
}
// draws is what an expansion has already drawn for its held names: the variant each
// was drawn as, so every path under it reads one row, and the value each read, by
// its one spelling, so the same read written twice reads one value.
// was drawn as, so every path under it reads one row, the value each read, by its one
// spelling, so the same read written twice reads one value, and the columns drawn null,
// so a read of one whole is null too.
type draws struct {
variant map[string]node
value map[string]string
nulls map[node]bool
}
func (d *draws) drewNull(column node) {
if d.nulls == nil {
d.nulls = map[node]bool{}
}
d.nulls[column] = true
}
// readField renders one arm of a token. An arm's key is a sibling field or a
@@ -299,7 +308,7 @@ func readField(s *session, t *template, held, refScope *draws, a arm) string {
}
return []node{n}, nil
},
leaf: func(n node) error { v = render(s, n, refScope); return nil },
leaf: func(n node) error { v, _ = renderColumn(s, n, refScope); return nil },
})
d.value[a.path] = v
return v