-
-
Notifications
You must be signed in to change notification settings - Fork 54
Description
Expected behavior
(ns my-ns.core
(:require
[cljs.spec.alpha :as s]))
Given this ns
, when I do an info op on s/keys
(a macro), it should return the macro metadata.
Actual behavior
Instead, it returns nil. The info op works fine for functions like s/explain
. It also works fine if I :refer
the macro explicitly.
Steps to reproduce the problem
I think the above illustrates the steps needed to reproduce.
I believe the issue is here:
orchard/src/orchard/cljs/meta.cljc
Line 90 in 0768f8e
(let [ns (or context-ns (macro-namespace env sym context-ns)) |
In my example, macro-namespace
is never called, so the code instead looks for the macro in my-ns.core
, where it doesn't exist. I took the naive approach of simply swapping the two arguments to or
and it seems to work for me. I can submit a pull request, but wanted to run it by you first to see if this solution even makes sense (I'm still fairly new to Clojure, and especially new to this codebase).
Environment & Version information
Clojure version
1.10.0
Java version
openjdk 11.0.10
Operating system
Debian unstable