From 2bd04b528a3a74c53f3b2d7b8be17045443c2d25 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 9 Oct 2026 11:18:51 +0200 Subject: [PATCH] Answer stability round 2: only a name bound to a reference hints reading the row without it --- arm.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arm.go b/arm.go index 2ae4971..8363fc9 100644 --- a/arm.go +++ b/arm.go @@ -100,7 +100,10 @@ func (t *template) compileArm(name string, targets map[*nameBinding]nameTarget) } b := t.nameScope.lookup(a.head) if grammar.HasSelector(a.tail) { - return a, fmt.Errorf("a path through name %q may not select a row; read it directly, {%s}, or bind the row to a name of its own", a.head, grammar.JoinSegments(append([]string{b.ref}, a.tail...))) + if !grammar.IsRef(b.ref) { + 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...))) } target := targets[b] full := append(target.tail[:len(target.tail):len(target.tail)], a.tail...)