A compound constant is to fold before a bounded variable checks it

This commit is contained in:
Joseph Ferano 2026-09-25 09:54:35 +07:00
parent f6cdb4e31b
commit 81569b60d8

View File

@ -659,7 +659,8 @@ because the walk goes over a struct's fields rather than a union's members.
Both are named in the decision as the arms to relax first if it is reopened, Both are named in the decision as the arms to relax first if it is reopened,
and a poisoned pointer is arguably the useful case. and a poisoned pointer is arguably the useful case.
** TODO A compound constant expression at a bounded type variable ** NEXT A compound constant expression at a bounded type variable
Decided 2026-09-25: fold constant integer arithmetic before the bounded-variable literal check, so =(+ x (+ 1 2))= is accepted where =(+ x 3)= is.
=(+ x (+ 1 2))= at a bounded variable is refused where =(+ x 3)= works — the =(+ x (+ 1 2))= at a bounded variable is refused where =(+ x 3)= works — the
literal arm admits a bare constant and nothing folds the compound first. literal arm admits a bare constant and nothing folds the compound first.
Walk-backable, so it waits until a body actually wants it. Walk-backable, so it waits until a body actually wants it.