Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Making apply-contract accept zero args

  • Loading branch information...
commit 3e74e67b03fcbacfbb8e9cb6c591e219eaecad15 1 parent 1bcd09d
@fogus fogus authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/main/clojure/clojure/core/contracts/constraints.clj
View
4 src/main/clojure/clojure/core/contracts/constraints.clj
@@ -167,8 +167,8 @@
(if (:hooked (meta f))
f
(with-meta
- (fn [m & args]
- (if-let [contract (-> m meta :contract)]
+ (fn [& [m & args]]
+ (if-let [contract (and m (-> m meta :contract))]
((partial contract identity) (apply f m args))
(apply f m args)))
{:hooked true})))
Please sign in to comment.
Something went wrong with that request. Please try again.