Skip to content

[Fix #408] Don't wrap cljs auto-aliased namespaces in :clj reader conditional#423

Merged
bbatsov merged 1 commit intomasterfrom
fix-408-clojure-math-cljc
May 9, 2026
Merged

[Fix #408] Don't wrap cljs auto-aliased namespaces in :clj reader conditional#423
bbatsov merged 1 commit intomasterfrom
fix-408-clojure-math-cljc

Conversation

@bbatsov
Copy link
Copy Markdown
Member

@bbatsov bbatsov commented May 9, 2026

Fixes #408.

suggest-libspecs was wrapping clojure.math in #?(:clj ...) inside .cljc files, even though ClojureScript auto-aliases clojure.math to cljs.math (and same for clojure.pprint, clojure.repl, etc.). The existing special case in files->platform only knew about clojure.test; I extended it via a small allowlist of paths that mirror cljs's aliasable-clj-ns? rule.

  • The commits are consistent with our contribution guidelines
  • You've added tests (if possible) to cover your change(s)
  • All tests are passing (run lein do clean, test)
  • Code inlining with mranderson works and tests pass with inlined code (run make install -- takes a long time)
  • You've updated the changelog (if adding/changing user-visible functionality)
  • You've updated the readme (if adding/changing user-visible functionality)

…ditional

ClojureScript's analyzer auto-aliases requires of clojure.test, clojure.math,
clojure.pprint and friends to their cljs.* counterparts, so a plain
[clojure.X :as ...] is valid in both Clojure and ClojureScript. The previous
hardcoded special case only handled clojure.test; extend it via a small
allowlist so suggest-libspecs no longer offers #?(:clj [clojure.math :as math])
inside .cljc files.
@bbatsov bbatsov merged commit 3443d7f into master May 9, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

suggest-libspec is suggesting clojure.math as clj only in cljc files

1 participant