Skip to content

Commit 9b67087

Browse files
ghadishaybanpuredanger
authored andcommitted
ASYNC-273: refix ASYNC-254: propagate meta from alts fret to chan op closures
1 parent 7771ef0 commit 9b67087

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/clojure/clojure/core/async.clj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,8 @@ return nil for unexpected contexts."
318318
(recur (unchecked-inc i))))
319319
^ints idxs (random-array n)
320320
priority (:priority opts)
321+
fret-with (fn [port]
322+
(with-meta #(fret [% port]) (meta fret)))
321323
ret
322324
(loop [i 0]
323325
(when (< i n)
@@ -326,8 +328,8 @@ return nil for unexpected contexts."
326328
wport (when (vector? port) (port 0))
327329
vbox (if wport
328330
(let [val (port 1)]
329-
(impl/put! wport val (alt-handler flag #(fret [% wport]))))
330-
(impl/take! port (alt-handler flag #(fret [% port]))))]
331+
(impl/put! wport val (alt-handler flag (fret-with wport))))
332+
(impl/take! port (alt-handler flag (fret-with port))))]
331333
(if vbox
332334
(channels/box [@vbox (or wport port)])
333335
(recur (inc i))))))]

0 commit comments

Comments
 (0)