Skip to content

info op fails for cljs macro in aliased namespace #106

@jobo3208

Description

@jobo3208

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:

(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

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