Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go-try throws ClassCastException: clojure.lang.Keyword incompatible with clojure.lang.IObj #18

Open
theronic opened this issue Nov 13, 2022 · 1 comment

Comments

@theronic
Copy link

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

@theronic theronic changed the title Encountered error when macroexpanding clojure.core.async/go. ClassCastException: clojure.lang.Keyword incompatible with clojure.lang.IObj go-try throws ClassCastException: clojure.lang.Keyword incompatible with clojure.lang.IObj Nov 13, 2022
@whilo
Copy link
Member

whilo commented Nov 16, 2022

Thanks for reporting! This is strange, it is not obvious to me where this comes from. Which version are you using?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants