Skip to content

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

Open

Description

@lilactown

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.

Activity

  1. changed the title [-]metadata is not forwarded between symbols[/-] [+]metadata is not forwarded to bound symbols in `p/let`[/+] on Aug 7, 2024
  2. niwinz commented on Dec 15, 2025

    @niwinz
    Member

    I have revisited this several times, but metadata is forwarded on bindings so i don't know how to properly solve that...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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