Skip to content

Commit c85b608

Browse files
fredrikekreJeffBezanson
authored andcommitted
Fully qualify at-everywhere, fixes #28966. (#32144)
(cherry picked from commit e6734fa)
1 parent d128ca1 commit c85b608

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

stdlib/Distributed/src/macros.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ Equivalent to calling `remotecall_eval(Main, procs, expr)`.
172172
"""
173173
macro everywhere(ex)
174174
procs = GlobalRef(@__MODULE__, :procs)
175-
return esc(:(@everywhere $procs() $ex))
175+
return esc(:($(Distributed).@everywhere $procs() $ex))
176176
end
177177

178178
macro everywhere(procs, ex)

stdlib/Distributed/test/distributed_exec.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,6 +1535,18 @@ for T in (UInt8, Int8, UInt16, Int16, UInt32, Int32, UInt64)
15351535
@test n == 55
15361536
end
15371537

1538+
# issue #28966
1539+
let code = """
1540+
import Distributed
1541+
Distributed.addprocs(1)
1542+
Distributed.@everywhere f() = myid()
1543+
for w in Distributed.workers()
1544+
@assert Distributed.remotecall_fetch(f, w) == w
1545+
end
1546+
"""
1547+
@test success(`$(Base.julia_cmd()) --startup-file=no -e $code`)
1548+
end
1549+
15381550
# Run topology tests last after removing all workers, since a given
15391551
# cluster at any time only supports a single topology.
15401552
rmprocs(workers())

0 commit comments

Comments
 (0)