Browse files

CLJS-488: resolve aliased keywords properly

  • Loading branch information...
1 parent a670691 commit 69741f2af76035e4adf1e6333c502095581b2179 @swannodette swannodette committed Mar 22, 2013
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/clj/cljs/analyzer.clj
@@ -655,6 +655,11 @@
{alias :as referred :refer :or {alias lib}} (apply hash-map opts)
[rk uk] (if macros? [:require-macros :use-macros] [:require :use])]
(when alias
+ ;; we need to create a fake namespace so the reader knows about aliases
+ ;; for resolving keywords like ::f/bar
+ (binding [*ns* (create-ns name)]
+ (let [^clojure.lang.Namespace ns (create-ns lib)]
+ (clojure.core/alias alias (.name ns))))
(let [alias-type (if macros? :macros :fns)]
(assert (not (contains? (alias-type @aliases)

0 comments on commit 69741f2

Please sign in to comment.