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"
11490
11490
prefer-table method-cache cached-hierarchy default-dispatch-val )))
11491
11491
11492
11492
(-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)
11494
11494
(throw (js/Error. (str " Preference conflict in multimethod '" name " ': " dispatch-val-y
11495
11495
" is already preferred to " dispatch-val-x))))
11496
11496
(swap! prefer-table
Original file line number Diff line number Diff line change 312
312
(is (= :parent (multi-with-h :child )))
313
313
)))
314
314
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
+
315
325
(deftest test-transducers
316
326
(testing " Testing transducers"
317
327
(is (= (sequence (map inc) (array 1 2 3 )) '(2 3 4 )))
You can’t perform that action at this time.
0 commit comments