fix: run @[init] declarations in declaration order#12221
Merged
Kha merged 2 commits intoleanprover:masterfrom Jan 29, 2026
Merged
fix: run @[init] declarations in declaration order#12221Kha merged 2 commits intoleanprover:masterfrom
@[init] declarations in declaration order#12221Kha merged 2 commits intoleanprover:masterfrom
Conversation
eric-wieser
reviewed
Jan 28, 2026
eric-wieser
approved these changes
Jan 28, 2026
Contributor
eric-wieser
left a comment
There was a problem hiding this comment.
Thanks, perhaps worth noting that this fixes #10175 again.
Rob23oba
reviewed
Jan 28, 2026
Comment on lines
+273
to
+274
| let r := m.foldl (fun a n p => a.push (n, p)) #[] | ||
| r.qsort (fun a b => Name.quickLt a.1 b.1) |
Contributor
There was a problem hiding this comment.
I don't think we need to sort, also why not use toArray?
Suggested change
| let r := m.foldl (fun a n p => a.push (n, p)) #[] | |
| r.qsort (fun a b => Name.quickLt a.1 b.1) | |
| (m : Std.TreeMap Name α Name.quickCmp).toArray |
eric-wieser
reviewed
Jan 28, 2026
Comment on lines
+5
to
+8
| private initialize ref3 : Unit ← ref.modify (·.push "ref3") | ||
| initialize ref2 : Unit ← ref.modify (·.push "ref2") | ||
| initialize ref1 : Unit ← ref.modify (·.push "ref1") | ||
| private initialize ref4 : Unit ← ref.modify (·.push "ref4") |
Contributor
There was a problem hiding this comment.
Perhaps worth adding
#guard (fun a => a.qsort (Name.quickLt) ≠ a) #[`ref3, `ref2, `ref1, `ref4]
before the test, to ensure that we didn't happen to pick names which hash in order.
Collaborator
|
Reference manual CI status:
|
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Jan 28, 2026
ghost
pushed a commit
to leanprover-community/mathlib4-nightly-testing
that referenced
this pull request
Jan 28, 2026
|
Mathlib CI status (docs):
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #10175 harder.