Issue using interop record constructors in macros namespaces

Description

Repro:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 (require 'cljs.js) (let [st (cljs.js/empty-state)] (cljs.js/eval-str st "(ns cljs.user (:require [foo.bar :refer-macros [cake]]))" nil {:eval cljs.js/js-eval :load (fn [{:keys [macros]} cb] (if macros (cb {:lang :clj :source "(ns foo.bar) (defmacro cake [] `(X.))"}) (cb {:lang :clj :source "(ns foo.bar) (defrecord X [])"})))} (fn [_] (cljs.js/eval-str st "(cake)" nil {:eval cljs.js/js-eval :context :expr} prn))))

Expected:

1 {:ns cljs.user, :value #foo.bar.X{}}

Master produces:

1 2 3 WARNING: Use of undeclared Var cljs.user/X at line 1 WARNING: Use of undeclared Var cljs.user/X at line 1 {:error #error {:message "ERROR", :data {:tag :cljs/analysis-error}, :cause #object[TypeError TypeError: cljs.user.X is not a constructor]}}

Not a regression as far as I can tell, and also affects regular JVM ClojureScript.

Environment

None

Status

Assignee

David Nolen

Reporter

Mike Fikes

Labels

Approval

Accepted

Patch

Code and Test

Fix versions

Affects versions

1.9.671

Priority

Major
Configure