Uploaded image for project: 'ClojureScript'
  1. CLJS-3049

Undefined fdef is still present in result of (stest/checkable-syms)

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Completed
    • Affects versions: None
    • Fix versions: None
    • Labels:
    • Approval:
      Accepted
    • Patch:
      Code and Test

      Description

      When looking into the code of CLJS-2844 Closed , I noticed that there isn't special handling of nil here:
      https://github.com/clojure/clojurescript/blob/master/src/main/cljs/cljs/spec/alpha.cljc#L71
      This has the result that after undefining a spec, it's still present in the result of (stest/checkable-syms).

      Example:

      (require '[clojure.spec.alpha :as s])
      (require '[clojure.spec.test.alpha :as stest])
      (defn foo [x] x)
      (s/fdef foo :args (s/cat :x number?) :ret number?)
      (stest/checkable-syms) ;;=> #{cljs.user/foo}
      (s/def foo nil)
      (stest/checkable-syms) ;;=> #{cljs.user/foo}
      

      Patch CLJS-3049 Closed .patch fixes this and provides a test for it.

        Attachments

          Activity

            People

            • Assignee:
              dnolen David Nolen
              Reporter:
              borkdude Michiel Borkent
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: