Hold each name in one formatOps map, beside its first reader and path

This commit is contained in:
2026-09-29 11:20:09 +02:00
committed by Lillem4n
parent 1b219e333a
commit bb70688f1d
5 changed files with 34 additions and 38 deletions
+1 -1
View File
@@ -164,7 +164,7 @@ func readField(s *session, t *template, held *hold, sc renderScope, a arm) readV
if sc.set.trace != nil {
traceRead(sc.set.trace, t, sc, a)
}
if !t.compiled.held[a.head] {
if _, expansionHolds := t.compiled.held[a.head]; !expansionHolds {
if len(a.tail) > 0 {
panic(internalError("%q reads a path into %q, which the expansion does not hold", a.spelling, a.head))
}