Skip to content
Browse files

Making apply-contract accept zero args

  • Loading branch information...
1 parent 1bcd09d commit 3e74e67b03fcbacfbb8e9cb6c591e219eaecad15 @fogus fogus committed
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})))

0 comments on commit 3e74e67

Please sign in to comment.
Something went wrong with that request. Please try again.