Permalink
Browse files

fixed hierarchic multimethods bug, refs #126

  • Loading branch information...
1 parent cf0e9bc commit f4c0de502c92ce710da923888d672f22213b902c Takahiro Hozumi committed with swannodette Jan 18, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/cljs/cljs/core.cljs
View
5 src/cljs/cljs/core.cljs
@@ -3383,7 +3383,7 @@ reduces them without incurring seq initialization"
(defn- find-and-cache-best-method
[name dispatch-val hierarchy method-table prefer-table method-cache cached-hierarchy]
(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))
e
be)]
@@ -3392,7 +3392,8 @@ reduces them without incurring seq initialization"
(str "Multiple methods in multimethod '" name
"' match dispatch value: " dispatch-val " -> " k
" and " (first be2) ", and neither is preferred"))))
- be2)))
+ be2)
+ be))
nil @method-table)]
(when best-entry
(if (= @cached-hierarchy @hierarchy)

0 comments on commit f4c0de5

Please sign in to comment.