Slightly improve inferred types in runtests#100
Conversation
| # Use a copy of p to prevent it from being boxed | ||
| p2 = p |
There was a problem hiding this comment.
This isn't a copy, it's the same as p, no?
There was a problem hiding this comment.
Also, how did you see p is boxed? JETLS doesn't detect it.
There was a problem hiding this comment.
Yes sorry I meant create a new binding instead of assigning to the existing one. I used Cthulhu.
There was a problem hiding this comment.
Can you please at least fix the comment? It's rather misleading as is now.
There was a problem hiding this comment.
JETLS doesn't detect it.
Oh, I had to wait some more time for JETLS to finish the analysis and report p as boxed.
| jobs = something(args.jobs, default_njobs()) | ||
| jobs = clamp(jobs, 1, length(tests)) | ||
| jobs::Int = clamp(jobs, 1, length(tests)) |
There was a problem hiding this comment.
Even with this change, the first jobs is reported as boxed by JETLS. Maybe do something like
_jobs = something(args.jobs, default_njobs())
jobs = clamp(_jobs, 1, length(tests))?
|
This PR broke reusing workers. |
This avoids
panddonebeing boxed and improves the inferred type ofjobsfromAnytoInt. This also leads to some of the types of downstream variables --- e.g.,workers--- being inferred.