-
Notifications
You must be signed in to change notification settings - Fork 733
fix: avoid panic in async elaboration for theorems with docstrings in where
#11896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… `where` This PR fixes a panic that occurred when a theorem had a docstring on an auxiliary definition within a `where` clause. The issue was that `asyncMayModify` used `.any` to check if a nested declaration could have its extension state modified, which returned `false` when the declaration wasn't yet in `asyncConsts`. Using `.all` instead returns `true` for `none` (vacuously true), allowing modification of extension state for nested declarations that haven't been added to `asyncConsts` yet. Closes #11799 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Collaborator
|
Mathlib CI status (docs):
|
Collaborator
|
Reference manual CI status:
|
adomani
reviewed
Jan 5, 2026
| /-- first aux -/ aux1 := True.intro | ||
| /-- second aux -/ aux2 := True.intro | ||
|
|
||
| -- Verify the docstrings are actually attached |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not seem to be testing the doc-strings, but rather that the functions themselves exist, right?
Use `findDocString?` to verify the docstrings are correctly set, rather than just checking the declarations exist. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
9f81281 to
c24b063
Compare
Use `.trimAscii` to ignore leading/trailing whitespace when comparing docstrings, since `/-- doc -/` includes the trailing space. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
c24b063 to
37acc90
Compare
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes a panic that occurred when a theorem had a docstring on an
auxiliary definition within a
whereclause.Reproducer:
The issue was that
asyncMayModifyused.anyto check if a nesteddeclaration could have its extension state modified, which returned
falsewhen the declaration wasn't yet inasyncConsts. Using.allinstead returns
truefornone(vacuously true), allowing modificationof extension state for nested declarations that haven't been added to
asyncConstsyet.Closes #11799
🤖 Prepared with Claude Code