Answer architecture round 2: linkTemplates' doc says which steps pass names as arguments, checkEveryNameRead, and an invariant guard on a binding with no read at link

This commit is contained in:
2026-10-05 22:34:39 +02:00
committed by Lillem4n
parent 0993d86f22
commit 69703dec91
3 changed files with 9 additions and 5 deletions
+3 -3
View File
@@ -96,11 +96,11 @@ func bindNames(root node) error {
if err != nil {
return err
}
return checkRead(scopes, read)
return checkEveryNameRead(scopes, read)
}
// checkRead refuses a binding of scopes that read does not hold.
func checkRead(scopes []*nameScope, read map[*nameBinding]bool) error {
// checkEveryNameRead refuses a binding of scopes that nothing reads.
func checkEveryNameRead(scopes []*nameScope, read map[*nameBinding]bool) error {
for _, sc := range scopes {
for _, b := range sc.order {
if !read[b] {