Skip to content

refactor(analyser): give old scope bindings their resolver symbol 馃 - #232

Open
timfennis wants to merge 1 commit into
feat/new-analyserfrom
feat/bindings-carry-symbols
Open

timfennis wants to merge 1 commit into
feat/new-analyserfrom
feat/bindings-carry-symbols

Conversation

@timfennis

Copy link
Copy Markdown
Owner

Phase 2, step 2, stacked on #231.

The old analyser chooses overloads by writing slot numbers, so lookups can't move to the resolver until both describe bindings the same way. This makes each binding in the old scope tree record the resolver symbol it corresponds to. The next steps can then look names up through the resolver and map the symbols back to the old slots.

  • ScopeBinding gains symbol. Every creation site passes it: let and loop patterns, parameters, named functions, and struct constructors, getters and setters. They go through one Analyser::create_local_binding, which debug-asserts that the binding's name matches its symbol's. Natives get their symbols when the analyser is created, in registry order, with the same check.
  • The resolver gains small accessors for the analyser: declared_symbol, struct_symbols, native_symbols and symbol_name. native_slots from feat(analyser): record each native's registry slot 馃敘聽#231 is now read, so its expect(dead_code) is gone.
  • The old scope.rs unit tests pass a placeholder symbol, since they test slots, not symbols.

No behaviour change. All 747 tests pass with the assertions active. I checked that swapping a struct's getter and setter symbols makes the assertion fail.

馃 Generated with Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
馃摑 Code Review 鈿狅笍 Failed 2026-10-13T14:45:13.188510Z d296278 PR opened
鈩癸笍 About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 馃憖 while any review is running, comments if it has suggestions, and reacts with 馃憤 once all reviews finish with no findings.

Base automatically changed from feat/native-slots to feat/new-analyser October 13, 2026 14:44
Each binding in the old scope tree records the name resolver's symbol
for it: `let` and loop patterns, parameters, named functions, struct
constructors and accessors, and natives. Debug assertions check that
every binding's name matches its symbol's. Nothing reads the symbols
yet; the next steps move lookups onto the resolver through them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@timfennis
timfennis force-pushed the feat/bindings-carry-symbols branch from d296278 to a6e3049 Compare October 13, 2026 14:47

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant