From 20aaa9e3467008f8ae0276521582403986965779 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sat, 21 Feb 2026 03:19:51 -0500 Subject: [PATCH] Fix a JET error regarding the existence of the local variable `reducer` at a certain point (#169) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a forward-port of https://github.com/JuliaLang/Distributed.jl/pull/169 (https://github.com/JuliaLang/Distributed.jl/commit/1bc91f97a75c1ac321ed28dfca072cbabfad7b4c). ``` ┌ var"@distributed"(__source__::LineNumberNode, __module__::Module, args::Vararg{Any}) @ Distributed /workpath/Distributed.jl/src/macros.jl:363 │ local variable `reducer` may be undefined: reducer::Any └──────────────────── ``` (cherry picked from commit 1bc91f97a75c1ac321ed28dfca072cbabfad7b4c) --- src/macros.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/macros.jl b/src/macros.jl index c58faf6..ea98c60 100644 --- a/src/macros.jl +++ b/src/macros.jl @@ -333,6 +333,7 @@ completion. To wait for completion, prefix the call with [`@sync`](@ref), like : macro distributed(args...) na = length(args) if na==1 + reducer = identity loop = args[1] elseif na==2 reducer = args[1]