Repository navigation
Fix/exclusive range bounds 730 - #738
Open
1932819331hy-debug wants to merge 3 commits into
Open
1932819331hy-debug wants to merge 3 commits into
1932819331hy-debug wants to merge 3 commits into
Conversation
) Align exclusive and inclusive range lowering, retain outer bound reads under shadowing, and remove non-existent bound reads from loop back-edge analysis. Add regression shapes for shadowing, mutation, and side-effecting bounds. AI-assisted change; requires independent CI and end-to-end verification.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #730.
Root cause
Exclusive integer ranges previously re-evaluated their upper bound on every iteration, after the loop variable was introduced.
This caused incorrect behavior under variable shadowing, mutable bounds, and side-effecting expressions. Inclusive ranges already captured their bounds once, creating inconsistent semantics.
Changes
Verification
Fork validation PR: 1932819331hy-debug#6
Successful CI: https://github.com/1932819331hy-debug/Go-Hybrid/actions/runs/39175226566
Both quick and compiler jobs passed, including Rust workspace tests, checker corpus, differential tests, and Go integration checks.
AI-assisted implementation. Credit for the original bug report belongs to the reporter of #730.