Skip to content

fix: in add_inductive, add ctors to the environment after rechecking parameters, not before - #16742

Merged
nomeata merged 2 commits into
leanprover:masterfrom
arthur-adjedj:fix16736
Nov 25, 2026
Merged

nomeata merged 2 commits into
leanprover:masterfrom
arthur-adjedj:fix16736

Conversation

@arthur-adjedj

Copy link
Copy Markdown
Contributor

This PR fixes a non-critical bug in add_inductive whereby constructors of the type being defined could occur in parameters of nested occurrences of said type. The context in which such a thing was accepted is so restricted this could not lead to any soundness issue.

Closes #16736

@arthur-adjedj

Copy link
Copy Markdown
Contributor Author

changelog-language

@github-actions github-actions Bot added the changelog-language Language features and metaprograms label Nov 24, 2026
@nomeata
nomeata added this pull request to the merge queue Nov 25, 2026
Merged via the queue into leanprover:master with commit e1228b8 Nov 25, 2026
15 checks passed
nomeata added a commit to arthur-adjedj/lean4 that referenced this pull request Nov 26, 2026
downstream-green is green again on nightly-2026-11-25 (downstream-lean4 run 45801655564).

Conflict resolutions:
* kernel/inductive.cpp: keep leanprover#16742's order (check the nested applications before adding the constructors) and pass the inductive feature flags to `inductive_val`.
* tests/elab/16736.lean: the inductive type carries the feature flags.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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

Projects

None yet

2 participants