Repository navigation
Avoid boxed captured variables, and test for them - #217
Merged
Merged
Conversation
`historical_durations` and `historical_failures` were assigned on two paths and captured, and the local `create_testset` has keyword arguments, so both were stored in a `Core.Box` and lost their type. Load the history once, and make `create_testset` a top-level function since it captures nothing.
Use `Test.detect_closure_boxes`, available on Julia 1.14 and later.
christiangnrd
force-pushed
the
tb/closure-boxes
branch
from
October 31, 2026 18:00
806f820 to
105213f
Compare
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.
Test.detect_closure_boxes(Julia 1.14+) reports two methods whose lowered code allocates aCore.Box:runtests:historical_durations/historical_failureswere loaded separately on the--listpath and the normal path, and captured, so the double assignment boxed them. The history is now loaded once, before the--listcheck._runtests: the localcreate_testsethas keyword arguments, which boxes its binding. It captures nothing, so it is now a top-level function.This also adds a
closure boxestestsuite entry so new boxes get caught; it runs on the nightly CI job and is skipped before 1.14.