Skip to content

refactor: split registerParametricAttribute into extension creation and registration#14344

Draft
wkrozowski wants to merge 1 commit into
leanprover:masterfrom
wkrozowski:wojciech/splitParametricAttribute
Draft

refactor: split registerParametricAttribute into extension creation and registration#14344
wkrozowski wants to merge 1 commit into
leanprover:masterfrom
wkrozowski:wojciech/splitParametricAttribute

Conversation

@wkrozowski

Copy link
Copy Markdown
Contributor

This PR splits registerParametricAttribute into two composable pieces so that a parametric attribute's getParam can consult the attribute's own extension for entries set on other declarations.

registerParametricAttributeExt creates the backing environment extension from the extension-relevant fields alone (ref,preserveOrder, filterExport), and registerParametricAttributeForExt registers the attribute over a given extension. registerParametricAttribute is now the composition of the two, so existing callers are unaffected. This is a pure refactor with no behavior change.

This is preparatory work for warning when @[deprecated] points at an already-deprecated declaration (#14336): the deprecation extension can be created first, letting the attribute's getParam look up whether the replacement name is itself deprecated.

@wkrozowski wkrozowski added the changelog-no Do not include this PR in the release changelog label Jul 9, 2026
@github-actions github-actions Bot added toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN labels Jul 9, 2026
@leanprover-bot leanprover-bot added the builds-manual CI has verified that the Lean Language Reference builds against this PR label Jul 9, 2026
@leanprover-bot

leanprover-bot commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Reference manual CI status:

@mathlib-lean-pr-testing mathlib-lean-pr-testing Bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Jul 9, 2026
@mathlib-lean-pr-testing

Copy link
Copy Markdown

Mathlib CI status (docs):

@wkrozowski wkrozowski requested a review from Kha July 10, 2026 10:37
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 builds-mathlib CI has verified that Mathlib builds against this PR changelog-no Do not include this PR in the release changelog mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN 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