Derive a column's datatype in columnDatatype alone

This commit is contained in:
2026-09-28 11:15:09 +02:00
committed by Lillem4n
parent 86118e2710
commit b2ffac5317
4 changed files with 20 additions and 36 deletions
+2 -2
View File
@@ -34,8 +34,8 @@ func (p *valueProof) checkDatatype(path string, n node) error {
if !ok || t.datatype == DataTypeString {
return nil
}
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 r := t.readsColumn; r != nil && columnDatatype(r.column) == t.datatype {
return fmt.Errorf(`%s: %s takes datatype %s from the column it reads; drop "datatype"`, path, t.format, t.datatype)
}
if reason := p.proveColumnItem(t).not[t.datatype]; reason != "" {
return fmt.Errorf("%s: datatype %s: %s", path, t.datatype, reason)