diff --git a/stdlib/Distributed/src/macros.jl b/stdlib/Distributed/src/macros.jl index f04ad345f10bca..15faadb3c31fa3 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 f17d97697c27e2..383a6783a311d8 100644 --- a/stdlib/Distributed/test/distributed_exec.jl +++ b/stdlib/Distributed/test/distributed_exec.jl @@ -1527,6 +1527,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())