Repository navigation
fix(codegen): do not import a module fn for a parameter with the same name (#815) - #824
Conversation
… name (#815) `use Console;` made a parameter named `log` pull in a Console.log import. Now program_free_names skips the fn's own parameters, and resolve tracks local binders in scope. When a local captures a qualified `Mod.f` call, resolve now gives a clear error ("rename the local"). Before, the program linked wrong. Full support for that case needs the qualifier carried through the type checker and the backends. Refs #815 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0136P7ZjyGGiPhiEUxNGPwsr
|
Review these changes at https://app.gitnotebooks.com/hyperpolymath/affinescript/pull/824 |
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. |
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
|



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 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
dune runtestmain suite: 662 tests pass (659 on main plus these 3).Generated by Claude Code