Skip to content

format: say that a scope's variables are visible only within its in - #318

Merged
gnidan merged 1 commit into
mainfrom
format-scope-visibility
Oct 3, 2026
Merged

gnidan merged 1 commit into
mainfrom
format-scope-visibility

Conversation

@gnidan

@gnidan gnidan commented Oct 3, 2026

Copy link
Copy Markdown
Member

The scope collection's description says its in pointer is "defined with the aid of" the variables in define, but it never says whether those variables stay visible afterwards. This states it: a scope's variables are visible only within its in. Pointers outside the scope, such as later members of an enclosing group, see only the variables of their own enclosing scopes, and a variable that reuses an outer identifier shadows it only within in.

This is the reading solc's storage templates already depend on (argotorg/solidity#16990): a struct template whose string member defines slot for its own use expects the members after it to see the struct's slot. @ethdebug/pointers let those variables leak until #317.

The schema description and the collections docs page say it, and the changelog records the impact: no change for producers, and consumers that keep a scope's variables after its in must discard them there.

@gnidan
gnidan force-pushed the format-scope-visibility branch from 7ccd623 to f3a60ee Compare October 3, 2026 19:12
@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-03 19:42 UTC

@gnidan
gnidan merged commit ec7a813 into main Oct 3, 2026
8 checks passed
@gnidan
gnidan deleted the format-scope-visibility branch October 3, 2026 19:37
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