File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -11490,7 +11490,7 @@ reduces them without incurring seq initialization"
1149011490 prefer-table method-cache cached-hierarchy default-dispatch-val )))
1149111491
1149211492 (-prefer-method [mf dispatch-val-x dispatch-val-y]
11493- (when (prefers* dispatch-val-x dispatch-val-y prefer-table)
11493+ (when (prefers* dispatch-val-y dispatch-val-x prefer-table)
1149411494 (throw (js/Error. (str " Preference conflict in multimethod '" name " ': " dispatch-val-y
1149511495 " is already preferred to " dispatch-val-x))))
1149611496 (swap! prefer-table
Original file line number Diff line number Diff line change 312312 (is (= :parent (multi-with-h :child )))
313313)))
314314
315+ (def tmph (make-hierarchy ))
316+ (defmulti fooz (fn [a b] (keyword b)) :hierarchy #'tmph)
317+ (defmethod fooz :a [a b] a )
318+ (defmethod fooz :b [a b] b )
319+ (prefer-method fooz :a :b )
320+
321+ (deftest test-cljs-3367-backward-conflict-prefers
322+ (testing " CLJS-3367: Verify no backward conflict in prefer-method"
323+ (is (some? (prefer-method fooz :a :b )))))
324+
315325(deftest test-transducers
316326 (testing " Testing transducers"
317327 (is (= (sequence (map inc) (array 1 2 3 )) '(2 3 4 )))
You can’t perform that action at this time.
0 commit comments