Answer stability round 3: the selector hint asks bindsField

This commit is contained in:
2026-10-09 11:22:07 +02:00
committed by Lillem4n
parent 8989cae9d9
commit 75c8b74cdc
+1 -1
View File
@@ -100,7 +100,7 @@ func (t *template) compileArm(name string, targets map[*nameBinding]nameTarget)
} }
b := t.nameScope.lookup(a.head) b := t.nameScope.lookup(a.head)
if grammar.HasSelector(a.tail) { if grammar.HasSelector(a.tail) {
if !grammar.IsRef(b.ref) { if b.bindsField() {
return a, fmt.Errorf("a path through name %q may not select a row; bind the row to a name of its own", a.head) return a, fmt.Errorf("a path through name %q may not select a row; bind the row to a name of its own", a.head)
} }
return a, fmt.Errorf("a path through name %q may not select a row; read the row without the name, {%s}, or bind it to a name of its own", a.head, grammar.JoinSegments(append([]string{b.ref}, a.tail...))) return a, fmt.Errorf("a path through name %q may not select a row; read the row without the name, {%s}, or bind it to a name of its own", a.head, grammar.JoinSegments(append([]string{b.ref}, a.tail...)))