Skip to content

fix: prefer cursor fields over same-named local reads - #24

Merged
RandomChirp merged 1 commit into
FoxDevCommunity:mainfrom
edname:codex/local-field-precedence
Oct 11, 2026
Merged

RandomChirp merged 1 commit into
FoxDevCommunity:mainfrom
edname:codex/local-field-precedence

Conversation

@edname

@edname edname commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Fix field precedence over same-named local variables

A bare expression that shares its name with a LOCAL currently compiles to
LoadLocal, bypassing the active cursor field. For example, LOCAL m.item_id then
m.item_id = item_id reads the default .F. instead of a numeric field, so a later
INSERT fails with error 9.

Emit LoadName for bare expression reads and check the selected cursor field
before the current function's local slot. Preserve explicit m.name reads,
assignment targets, internal temporaries and private/public fallback. Rebuild
compiled bundles to get the corrected instructions; bytecode layout is unchanged.

Validation: synthetic reproduction fails before the change. Six focused cases,
680 full VM tests including doctests, and 16 WASM bridge/sample tests pass.
WASM, typecheck, lint and application build pass on macOS ARM64. Native Windows
VFP was not run. Fixtures are synthetic; developed with AI assistance.

@RandomChirp
RandomChirp merged commit 59df0d9 into FoxDevCommunity:main Oct 11, 2026
3 checks passed
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.

2 participants