-
-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Description
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.
niwinz
Metadata
Metadata
Assignees
Labels
No labels