Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
MATCH-36: if no matching clause given throw exception
Throw IllegalArgumentException displaying the values we were unable to match.
  • Loading branch information
swannodette committed Jun 16, 2013
1 parent e4982ed commit 63e56f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/clojure/clojure/core/match.clj
Expand Up @@ -1791,7 +1791,7 @@
(conj (vec (butlast cs)) [last-match a])
;; TODO: throw an exception if :else line not provided - David
(if default
(conj (vec cs) [last-match nil])
(conj (vec cs) [last-match `(throw (IllegalArgumentException. (str "No matching clause: " ~@(interpose " " vars))))])
cs)))]
(pattern-matrix
(vec (map #(apply to-pattern-row %) cs))
Expand Down

0 comments on commit 63e56f5

Please sign in to comment.