Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixed hierarchic multimethods bug, refs #126
  • Loading branch information
Takahiro Hozumi authored and swannodette committed Jan 18, 2012
1 parent cf0e9bc commit f4c0de5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cljs/cljs/core.cljs
Expand Up @@ -3383,7 +3383,7 @@ reduces them without incurring seq initialization"
(defn- find-and-cache-best-method (defn- find-and-cache-best-method
[name dispatch-val hierarchy method-table prefer-table method-cache cached-hierarchy] [name dispatch-val hierarchy method-table prefer-table method-cache cached-hierarchy]
(let [best-entry (reduce (fn [be [k _ :as e]] (let [best-entry (reduce (fn [be [k _ :as e]]
(when (isa? dispatch-val k) (if (isa? dispatch-val k)
(let [be2 (if (or (nil? be) (dominates k (first be) prefer-table)) (let [be2 (if (or (nil? be) (dominates k (first be) prefer-table))
e e
be)] be)]
Expand All @@ -3392,7 +3392,8 @@ reduces them without incurring seq initialization"
(str "Multiple methods in multimethod '" name (str "Multiple methods in multimethod '" name
"' match dispatch value: " dispatch-val " -> " k "' match dispatch value: " dispatch-val " -> " k
" and " (first be2) ", and neither is preferred")))) " and " (first be2) ", and neither is preferred"))))
be2))) be2)
be))
nil @method-table)] nil @method-table)]
(when best-entry (when best-entry
(if (= @cached-hierarchy @hierarchy) (if (= @cached-hierarchy @hierarchy)
Expand Down

0 comments on commit f4c0de5

Please sign in to comment.