Here’s a repro:
(defn wut [foo m]
(match m
[:m foo] :foo))
(wut 1 [:m 2])
;; Execution error (IllegalArgumentException) at user/wut (REPL:560).
;; No matching clause: [:m 2]
The gotcha here is that I am using foo both as an argument and as a local match binding. This works:
(defn wut [foo m]
(match m
[:m bar] :foo))
(wut 1 [:m 2])
;;=> :foo
I'm not sure if this is just what it is or if it is a problem that can be handled better by core.match? It def surprised me a lot and took a lot of time to figure out.