Skip to content

Conversation

@kmill
Copy link
Collaborator

@kmill kmill commented Mar 3, 2025

This PR modifies the instance synth order checker to detect projections-like instances, rather having special support only for constructor field projections. An instance is projection-like if the first instance implicit argument has a type that's a constant applied to all the preceding arguments in order — these arguments are assumed to be the parameters of the type.

In the future the class command will make all its generated parent projections use implicits for all parameters, making the generated projections all consistent.

This PR modifies the instance synth order checker to detect projections-like instances, rather having special support only for constructor field projections. An instance is projection-like if the first instance implicit argument has a type that's a constant applied to all the preceding arguments in order — these arguments are assumed to be the parameters of the type.

In the future the `class` command will make all its generated parent projections use implicits for all parameters, making the generated projections all consistent.
@kmill kmill added awaiting-review Waiting for someone to review the PR changelog-language Language features and metaprograms labels Mar 3, 2025
@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 Mar 3, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Mar 3, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Mar 3, 2025
@leanprover-community-bot leanprover-community-bot added the breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan label Mar 3, 2025
@leanprover-community-bot
Copy link
Collaborator

Mathlib CI status (docs):

@kmill kmill marked this pull request as draft March 3, 2025 23:51
@kmill kmill removed the awaiting-review Waiting for someone to review the PR label Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan 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.

2 participants