Report a held arm with no hold as an internal error, and name readHeld as the hold

This commit is contained in:
2026-09-29 03:43:11 +02:00
committed by Lillem4n
parent a9ec8b3632
commit 58e26c6d6b
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -41,6 +41,9 @@ func readField(s *session, t *template, held *hold, sc renderScope, a arm) readV
}
return readValue{text: render(s, t.head(a.key), sc)}
}
if held == nil {
panic(internalError("%q reads a name the expansion holds, with no hold to keep it in", a.spelling))
}
return readHeld(s, t, held, nil, sc, a)
}