Skip to content

Triage: v0.39.0 — a global first bound in a top-level for body is no longer visible outside the loop (if-block bindings still are) #959

Description

@InauguralPhysicist

Noticed downstream in ouroboros (harness hardening, ouroboros#101/#102): the parity program module_name_in_block.eigs had silently degraded — its second half now errors identically on both compilers, which the old harness masked as a green string-compare. Needs an upstream verdict: intended for-scope semantics, or regression?

Repro at v0.39.0:

for q in [1, 2]:
    acc is q
print of acc
Error line 3: undefined variable 'acc'

Same through a function read (define show() as: return acc after the loop) — undefined. The asymmetry is the suspicious part: an if-block first-binding IS still a module binding:

if 1 == 1:
    c is 7
define g() as:
    return c
print of (g of null)     # prints 7

So at v0.39.0 a name first bound in a top-level for body is loop-local (invisible even at module level after the loop), while if/other block bindings remain module bindings. Unknown which release changed it — the downstream harness vacuity hid the transition (any pin bump since the program was written is possible).

If intended: say so here and document the for-scope rule; ouroboros keeps the matched-behavior reject case (added in ouroboros#102) until told otherwise.
If regression: the ouroboros case is a matched-bug canary and will fail the moment a fixed pin restores the old behavior — that failure is the reminder to flip the case back to full parity in the same EIGS_REF bump.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions