Skip to content

Commit cdca668

Browse files
authored
Test: Add compiler hint for ts variable definedness in @testset for (#58989)
Helps the new language server avoid reporting unused variable reports.
1 parent 8596dbe commit cdca668

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

stdlib/Test/src/Test.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1975,6 +1975,7 @@ function testset_forloop(args, testloop, source)
19751975
# Handle `return` in test body
19761976
if !first_iteration && !finish_errored
19771977
pop_testset()
1978+
@assert @isdefined(ts) "Assertion to tell the compiler about the definedness of this variable"
19781979
push!(arr, finish(ts))
19791980
end
19801981
copy!(default_rng(), default_rng_orig)

0 commit comments

Comments
 (0)