Skip to content

Commit 00321e8

Browse files
committed
Fix a JET error around matching methods for push!(...) (#173)
* Fix a JET error around matching methods for `push!(...)` ``` ┌ @ Distributed /workpath/Distributed.jl/src/process_messages.jl:387 │ no matching method found `push!(::Nothing, ::Any)` (1/2 union split): Distributed.push!(default_worker_pool()::Union{Nothing, Distributed.AbstractWorkerPool}, w.id::Any) └──────────────────── ``` (cherry picked from commit f15f306adaafbedc2f431c96087da2ea483c9558) * Add a `::AbstractWorkerPool` return type annotation to `default_worker_pool()` * Add a type annotation in an additional place, to fix another JET error (cherry picked from commit b7c43b235a963d19ec1c5e5aa9b8a565b6e49c34)
1 parent 0d39458 commit 00321e8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/workerpool.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ julia> default_worker_pool()
288288
WorkerPool(Channel{Int64}(sz_max:9223372036854775807,sz_curr:3), Set([4, 2, 3]), RemoteChannel{Channel{Any}}(1, 1, 4))
289289
```
290290
"""
291-
function default_worker_pool()
291+
function default_worker_pool()::AbstractWorkerPool
292292
# On workers retrieve the default worker pool from the master when accessed
293293
# for the first time
294294
if _default_worker_pool[] === nothing
@@ -298,7 +298,7 @@ function default_worker_pool()
298298
_default_worker_pool[] = remotecall_fetch(()->default_worker_pool(), 1)
299299
end
300300
end
301-
return _default_worker_pool[]
301+
return _default_worker_pool[]::AbstractWorkerPool
302302
end
303303

304304
"""

0 commit comments

Comments
 (0)