Skip to content

fix: restore ambient exporting scope in mkAuxDefinition#14442

Merged
Kha merged 1 commit into
masterfrom
aux-def-expose-regression
Jul 18, 2026
Merged

fix: restore ambient exporting scope in mkAuxDefinition#14442
Kha merged 1 commit into
masterfrom
aux-def-expose-regression

Conversation

@Kha

@Kha Kha commented Jul 18, 2026

Copy link
Copy Markdown
Member

This PR fixes a regression from #14437 where the auxiliary definitions wrapping private references in exposed bodies (private_decl%) had their bodies exported, producing dangling references to private constants that broke importing modules in Mathlib.

This PR fixes a regression from #14437 where the auxiliary definitions wrapping `private` references in exposed bodies (`private_decl%`) had their bodies exported, producing dangling references to private constants that broke importing modules (caught by Mathlib CI).

`mkAuxDefinition` again adds the declaration under the ambient exporting scope; the `exposeBody` parameter introduced by #14437 is removed. `wrapInstance` instead wraps its `mkAuxDefinition` calls in `withoutExporting (when := !exposeAux)`: the aux names are minted under the ambient exporting scope beforehand, so the aux defs keep their public names and exported signatures while their bodies stay unexported, as required by the `inferInstanceAs` wrapper fix.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Kha Kha added the changelog-no Do not include this PR in the release changelog label Jul 18, 2026
@Kha
Kha enabled auto-merge July 18, 2026 11:20
@Kha
Kha added this pull request to the merge queue Jul 18, 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 Jul 18, 2026
@mathlib-lean-pr-testing

Copy link
Copy Markdown

Mathlib CI status (docs):

  • ❗ Mathlib CI can not be attempted yet, as the nightly-testing-2026-07-18 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-mathlib, Mathlib CI should run now. You can force Mathlib CI using the force-mathlib-ci label. (2026-07-18 11:41:53)

@leanprover-bot leanprover-bot added the builds-manual CI has verified that the Lean Language Reference builds against this PR label Jul 18, 2026
@leanprover-bot

leanprover-bot commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Reference manual CI status:

Merged via the queue into master with commit 5adc1e7 Jul 18, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

builds-manual CI has verified that the Lean Language Reference builds against this PR changelog-no Do not include this PR in the release changelog 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.

2 participants