Skip to content

hy-emit(rangebind): preserve outer bindings projected in same-name range hi bounds (fixes #3826) - #4450

Open
SuperPiIot wants to merge 1 commit into
limitlessprojects:mainfrom
SuperPiIot:fix-issue-3826
Open

SuperPiIot wants to merge 1 commit into
limitlessprojects:mainfrom
SuperPiIot:fix-issue-3826

Conversation

@SuperPiIot

Copy link
Copy Markdown

Fixes #3826\n\n### Summary\n- In compiler/crates/hy-emit/src/rangebind.rs (stmt_reads), add expr_projects_target(hi, target) so an inner for <var> in lo..hi whose hi projects <var> via Expr::Index, Expr::Field, or Expr::Slice (0..a[0], 0..it.n, 0..xs[i]) counts as reading the outer <var> binding.\n- Preserving the outer binding keeps var_in_scope == true in Emitter::emit_for, hoisting hyHi := hi before the loop header across for, match, and select scopes while keeping bare for v in 0..v blanking intact.\n- Adds regression coverage in compiler/crates/hy-emit/tests/rangebind_projected_same_name_hi.rs.\n\nCloses #3826\n/claim #3826\n\n### Payout Wallet\nBase (USDC): 0xf084cF0076F91AA48C2370F427C399dAA8C1f07F

@github-actions github-actions Bot added the bot:land-candidate Shepherd: fresh, gate-clean, verifiable (set from classify()) label Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:land-candidate Shepherd: fresh, gate-clean, verifiable (set from classify())

Projects

None yet

1 participant