Repository navigation
feat(analyser): put the name resolver in front of the analyser 🔗 - #230
Merged
Merged
Conversation
The resolver records an error per failing statement and carries on with the next one, at the top level and inside blocks, so `a; b;` reports both unknown names like the current analyser does. A failing statement still stops at its first error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The analyser runs the name resolver on each top-level statement first, with the registered natives as builtins, and reports its errors as analysis errors. A statement with unresolved names isn't analysed further, which would only repeat its errors. The resolver's state is part of the analyser checkpoint, so REPL lines that fail roll it back. `fn` after a `let` of the same name in one scope is now an error, as decided for the new resolver, so the functional test that relied on it adding an overload now expects that error. The analyser's unit tests for index assignment declare the `[]` and `[]=` natives they use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
timfennis
force-pushed
the
feat/new-analyser
branch
from
October 13, 2026 14:17
24c9a57 to
5f7036b
Compare
Codex Review SummaryThis 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. |
timfennis
force-pushed
the
feat/resolver-in-pipeline
branch
from
October 13, 2026 14:26
da6c433 to
39d6c02
Compare
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.
Stacked on #226 so these changes can be reviewed apart from the resolver work itself. The resolver on
feat/new-analyserproduced its results but nothing used them. This PR runs it in front of the existing analyser, so it handles every program and test, as phase 1 of replacing the old analyser. Phase 2 will turn the old analyser into the type pass.a; b;reports both names like the current analyser does.Analyser::analyseruns the resolver on each top-level statement first, with the registered natives as builtins. A statement with name errors isn't analysed further, so the same error isn't reported twice. The resolver's state is part of the analyser checkpoint, so a failed REPL line rolls it back. The compiler is unchanged.Worth a look:
fnafter aletof the same name in one scope is now an error, as decided for the resolver.005_functions/034became an error test, and the function page in the manual documents the rule.[]/[]=natives their index assignments use, because the resolver rejects index access without them.AugmentedCandidatesandStructSymbolsfields only the type pass will read are markedexpect(dead_code), so the marker becomes an error once they're used.🤖 Generated with Claude Code