Affects Version/s: 1.7.145
Fix Version/s: None
Background: When employing ns, if a namespace is required or used, and that namespace itself requires or uses macros from its own namespace, then the macros will be implicitly required or used using the same specifications.
This ticket asks for a mild extension to the above, automatically inferring when referred symbols are macro vars in two cases:
- :require / :refer
- :use / :only
Here is a concrete example illustrating the cases:
Assume src/foo/core.clj contains a single macro:
and src/foo/core.cljs requires that macro namespace:
Without loss of generality, assume we do the following in a REPL.
Currently, the code assumes that unless is a non-macro var and a "Referred var foo.core/unless does not exist" diagnostic is emitted. To satisfy this ticket, the code should consult the foo.core macro namespace for the existence of an unless macro, and refer it as ifhad been issued.
Likewise, this should work for the :use / :only dual form: Whenis issued.
Additionally, the same behavior should be ensured to work in bootstrapped mode.