Skip to content

fix: withNamespace now correctly calls popScopes after running#12647

Merged
wkrozowski merged 1 commit intoleanprover:masterfrom
wkrozowski:wojciech/12630
Feb 24, 2026
Merged

fix: withNamespace now correctly calls popScopes after running#12647
wkrozowski merged 1 commit intoleanprover:masterfrom
wkrozowski:wojciech/12630

Conversation

@wkrozowski
Copy link
Copy Markdown
Contributor

This PR adds the missing popScopes call to withNamespace, which previously
only dropped scopes from the elaborator's Command.State but did not pop the
environment's ScopedEnvExtension state stacks. This caused scoped syntax
declarations to leak keywords outside their namespace when withNamespace had
been called.

Closes #12630

This PR adds the missing `popScopes` call to `withNamespace`, which previously
only dropped scopes from the elaborator's `Command.State` but did not pop the
environment's `ScopedEnvExtension` state stacks. This caused scoped syntax
declarations to leak keywords outside their namespace when `withNamespace` had
been called.

Closes leanprover#12630

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wkrozowski wkrozowski added the changelog-language Language features and metaprograms label Feb 23, 2026
@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Feb 23, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 71fad35e59f79948a8d5f42efb22f484bfb9398f --onto 2e7fe7e79d151ee91039f086b8036252cdf9b725. You can force Mathlib CI using the force-mathlib-ci label. (2026-02-23 11:45:20)

@leanprover-bot
Copy link
Copy Markdown
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase 71fad35e59f79948a8d5f42efb22f484bfb9398f --onto 8038a8b8904f89ad9542c8eda11379f8f006eab1. You can force reference manual CI using the force-manual-ci label. (2026-02-23 11:45:22)

@wkrozowski wkrozowski added this pull request to the merge queue Feb 24, 2026
Merged via the queue into leanprover:master with commit f31f508 Feb 24, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-language Language features and metaprograms toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

withNamespace doesn't correctly call popScopes after running

2 participants