tell a grouped for header by its shape, not by a var in it

(for ((= s 0) (< s n) (++ s)) ...) passed the check and reached cc as
a call of (= s 0).
This commit is contained in:
2026-10-14 20:08:39 +03:00
parent d92b5fc696
commit d0e806bf84
2 changed files with 6 additions and 3 deletions

View File

@@ -338,6 +338,9 @@ whitespace aside, THEN?"
(test-assert "a grouped header is named"
(reports? (in-fn "(for ((var i int 0) (< i 4) (++ i)) (g i))")
"header is not grouped"))
(test-assert "whatever its init is"
(reports? (in-fn "(for ((= a 0) (< a 4) (++ a)) (g a))")
"header is not grouped"))
(test-assert "even when the body fills the slots it left"
(reports? (in-fn "(for ((var i int 0) (< i 4) (++ i)) (g i) (g i) (g i))")
"header is not grouped"))