Welcome! Please see the About page for a little more info on how this works.

0 votes
in core.async by

If there is a "if" in a "finally" block and the enclosing "try" is in a CLJS "go" block, then the result of the "try" is always nil.

Example code:

(ns demo
(:require-macros
(link: cljs.core.async.macros :refer [go)]))

;; Prints: "in a try"
(println (try "in a try" (finally (if true nil ))))

;; Prints: "in a try"
(go (println (try "in a try" (finally nil))))

;; Prints: nil
(go (println (try "in a try" (finally (if true nil )))))

3 Answers

0 votes
by

Comment made by: hubert

Also fails with:
org.clojure/clojure "1.8.0"
org.clojure/clojurescript "1.9.671"
org.clojure/core.async "0.3.443"

0 votes
by

Comment made by: hiredman

this is likely a result of the brokeness in the try/catch handling in go blocks that should be fixed with https://dev.clojure.org/jira/browse/ASYNC-184

0 votes
by
Reference: https://clojure.atlassian.net/browse/ASYNC-199 (reported by alex+import)
...