-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Issue #20062: make Random.reserve type-stable #22446
Conversation
(CI failures were timeouts except AV i686, which looks like an unrelated |
test/random.jl
Outdated
@test !Base.Random.mt_empty(r); @inferred Base.Random.reserve_1(r) | ||
|
||
rand(r) | ||
@test 0 < Base.Random.mt_avail(r) < Base.Random.MTCacheLength; @inferred Base.Random.reserve(r, Base.Random.mt_avail(r)) |
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.
these seem like two separate tests, and go over the line length recommendation
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.
I was probably being overly-cautious with these tests, trying to test inferred return type on different conditions of mt_avail
. Probably sufficient to test once only. Will update to simplify.
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.
Thanks!
Issue #20062
Not a performance issue, but does pollute
@code_warntype
for functions that includerand()
.Also thought that returning
nothing
better documents that return value is not used.