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

metadata is not forwarded to bound symbols in p/let #155

Open
lilactown opened this issue Aug 7, 2024 · 0 comments
Open

metadata is not forwarded to bound symbols in p/let #155

lilactown opened this issue Aug 7, 2024 · 0 comments

Comments

@lilactown
Copy link

I have in a ClojureScript project something akin to:

(ns app.foo
  (:require
    [promesa.core :as p]))

(deftype Foo [bar baz])

(defn foo
  [bar baz]
  (->Foo bar baz))

(p/let [x (foo "bar" "baz")]
  (set! (.-bar foo) "qux")))

shadow-cljs compiles the code with a warning "Cannot infer target type in expression: (set! (.-bar foo) "qux")". Changing the code to use let instead of p/let fixes the issue.

I believe (via our Slack thread) that this is because x does not get the correct metadata attached to it when p/let is constructing the bindings.

@lilactown lilactown changed the title metadata is not forwarded between symbols metadata is not forwarded to bound symbols in p/let Aug 7, 2024
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

1 participant