Skip to content

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

@theronic

Description

@theronic

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions