Created
June 12, 2016 17:58
-
-
Save laczoka/acd65028f5a46338e33c940d49d01753 to your computer and use it in GitHub Desktop.
Possible bug: c.spec/fn-specs doesn't always work on aliased symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; using clojure 1.9.0-alpha5 | |
(ns aaa (:require [clojure.spec :as sp])) | |
(in-ns 'aaa) | |
(defn plus [a b] (+ a b)) | |
(sp/fdef plus :args (sp/cat :a number? :b number?)) | |
(assert (not (nil? (:args (sp/fn-specs 'plus))))) | |
(ns bbb (:require [aaa :as aa] [clojure.spec :as sp])) | |
(in-ns 'bbb) | |
(assert (not (nil? (:args (sp/fn-specs 'aa/plus))))) | |
(defn spec-plus [] (sp/fn-specs 'aa/plus)) | |
;; uncomment the following line to fix it | |
;; (defn spec-plus [] (sp/fn-specs 'aaa/plus)) | |
(ns ccc (:require [bbb :refer [spec-plus]])) | |
(in-ns 'ccc) | |
(assert (not (nil? (:args (spec-plus))))) ;; => FAIL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment