Skip to content

Commit 5a02f8e

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 017e4cc commit 5a02f8e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/workerpool.jl

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

305305
"""

0 commit comments

Comments
 (0)