Skip to content

Commit

Permalink
CLJS-488: resolve aliased keywords properly
Browse files Browse the repository at this point in the history
  • Loading branch information
swannodette committed Mar 22, 2013
1 parent a670691 commit 69741f2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/clj/cljs/analyzer.clj
Expand Up @@ -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)
alias))
Expand Down

0 comments on commit 69741f2

Please sign in to comment.