superv.async
superv.async copied to clipboard
go-try throws ClassCastException: clojure.lang.Keyword incompatible with clojure.lang.IObj
Trying to use superv.async in my ClojureScript project, but (go-try S ...) throws a ClassCastException at compile time:
(ns myproject.async-test
(:require [cljs.test :as t :refer (deftest testing is async)]
[cljs.core.async :refer (go <!)]
[superv.async :refer (S <? go-try)]))
(deftest my-tests
(testing "why won't this run?"
(async done
(let [ch (go (ex-info "hi" {:data 123}))]
(go-try S ;; this complains.
(<! ch)
(done))))))
Error:
7 | (testing "why won't this run?"
8 | (async done
9 | (let [ch (go (ex-info "hi" {:data 123}))]
10 | (go-try S
---------------^----------------------------------------------------------------
Encountered error when macroexpanding clojure.core.async/go.
ClassCastException: clojure.lang.Keyword incompatible with clojure.lang.IObj
clojure.core/with-meta--5485 (core.clj:219)
clojure.core/vary-meta (core.clj:677)
clojure.core/vary-meta (core.clj:677)
clojure.core.async/go/fn--2080 (async.clj:464)
Encountered error when macroexpanding clojure.core.async/go. ClassCastException: clojure.lang.Keyword incompatible with clojure.lang.IObj
Thanks for reporting! This is strange, it is not obvious to me where this comes from. Which version are you using?