diff --git a/stdlib/Distributed/src/macros.jl b/stdlib/Distributed/src/macros.jl index f04ad345f10bc..15faadb3c31fa 100644 --- a/stdlib/Distributed/src/macros.jl +++ b/stdlib/Distributed/src/macros.jl @@ -251,7 +251,7 @@ end function preduce(reducer, f, R) N = length(R) - chunks = splitrange(N, nworkers()) + chunks = splitrange(Int(N), nworkers()) all_w = workers()[1:length(chunks)] w_exec = Task[] diff --git a/stdlib/Distributed/test/distributed_exec.jl b/stdlib/Distributed/test/distributed_exec.jl index 04ef09d495a2d..d715dc0b62767 100644 --- a/stdlib/Distributed/test/distributed_exec.jl +++ b/stdlib/Distributed/test/distributed_exec.jl @@ -1525,6 +1525,14 @@ end a27933 = :_not_defined_27933 @test remotecall_fetch(()->a27933, first(workers())) === a27933 +# PR #28651 +for T in (UInt8, Int8, UInt16, Int16, UInt32, Int32, UInt64) + n = @distributed (+) for i in Base.OneTo(T(10)) + i + end + @test n == 55 +end + # Run topology tests last after removing all workers, since a given # cluster at any time only supports a single topology. rmprocs(workers())