Repository navigation
fix(codegen): do not import a module fn for a parameter with the same name (#815) - #820
Conversation
|
Review these changes at https://app.gitnotebooks.com/hyperpolymath/affinescript/pull/820 |
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
e1d9f76 to
fbf1f7a
Compare
fbf1f7a to
e94a5f9
Compare
|
… name (#815) (#824) Refs #815 Replaces #820. A push error of mine put main's tip on the #820 branch, so GitHub closed #820 as "merged" with no change. This PR has the same change, rebased on main (after #823). The only new work is the conflict in test/test_e2e.ml: both PRs add tests to `modmut561_tests`, and this PR keeps both sets. ## Summary - `program_free_names` (lib/codegen.ml) now skips a fn's own parameter names. A parameter named `log` under `use Console;` no longer adds a `Console.log` import. - `lower_qualified_value_paths` (lib/resolve.ml) tracks the local binders in scope: let, lambda, match, handler, for and fn params. - When a local captures a qualified `Mod.f` call, resolve gives a clear error: "`Mod.fn` is shadowed by a local `fn` in scope; rename the local". Before, that program linked wrong. ## Gap that remains Issue test 2 (same param plus a qualified call: import kept and links) now gives the clear error. It does not compile yet. Full support needs the qualifier carried through the type checker and the backends (size L). This PR uses "Refs", not "Closes". ## Tests - 3 new e2e tests: param only (no import), qualified call (import kept), capture (error). - `dune runtest` main suite: 662 tests pass (659 on main plus these 3). --- _Generated by [Claude Code](https://claude.ai/code)_ Co-authored-by: Claude <noreply@anthropic.com>



Refs #815
Summary
program_free_names(lib/codegen.ml) now skips a fn's own parameter names. A parameter namedlogunderuse Console;no longer adds aConsole.logimport.lower_qualified_value_paths(lib/resolve.ml) tracks the local binders in scope: let, lambda, match, handler, for and fn params.Mod.fcall, resolve gives a clear error: "Mod.fnis shadowed by a localfnin scope; rename the local". Before, that program linked wrong.Gap that remains
Issue test 2 (same param plus a qualified call: import kept and links) now gives the clear error. It does not compile yet. Full support needs the qualifier carried through the type checker and the backends (size L). This PR uses "Refs", not "Closes".
Tests
Generated by Claude Code