Permalink
Browse files

CLJ-1034: fix false conflicts in data reader mappings

Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
  • Loading branch information...
1 parent 1c8eb16 commit 75352eba4d13ee707b7f0bac18960701bbde6921 @jkk jkk committed with stuarthalloway Aug 10, 2012
Showing with 8 additions and 6 deletions.
  1. +8 −6 src/clj/clojure/core.clj
View
14 src/clj/clojure/core.clj
@@ -6768,12 +6768,14 @@
(throw (ex-info (str "Invalid form in data-reader file")
{:url url
:form k})))
- (when (contains? mappings k)
- (throw (ex-info "Conflicting data-reader mapping"
- {:url url
- :conflict k
- :mappings m})))
- (assoc m k (data-reader-var v)))
+ (let [v-var (data-reader-var v)]
+ (when (and (contains? mappings k)
+ (not= (mappings k) v-var))
+ (throw (ex-info "Conflicting data-reader mapping"
+ {:url url
+ :conflict k
+ :mappings m})))
+ (assoc m k v-var)))
mappings
new-mappings)))))

0 comments on commit 75352eb

Please sign in to comment.