We're updating the issue view to help you get more done. 

[core.specs] spec for fn does not allow anonymous function name

Description

In the following macro code fragment, the function ID `fixture-fn` causes the anonymous function to fail clojure.spec:

1 2 3 4 5 `(ct/use-fixtures ~mode (fn fixture-fn [tgt-fn#] (~enter-fn ~ctx) (tgt-fn#) (~leave-fn ~ctx))))

When function name fixture-fn is absent, compilation proceeds and clojure.spec works fine. When function name is present,
the error message is:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 Caused by: clojure.lang.ExceptionInfo: Call to clojure.core/fn did not conform to spec. {:clojure.spec.alpha/problems ({:path [:fn-tail :arity-1 :params], :pred clojure.core/vector?, :val tupelo.test/fixture-fn, :via [:clojure.core.specs.alpha/params+body :clojure.core.specs.alpha/param-list :clojure.core.specs.alpha/param-list], :in [0]} {:path [:fn-tail :arity-n], :pred (clojure.core/fn [%] (clojure.core/or (clojure.core/nil? %) (clojure.core/sequential? %))), :val tupelo.test/fixture-fn, :via [:clojure.core.specs.alpha/params+body :clojure.core.specs.alpha/params+body], :in [0]}), :clojure.spec.alpha/spec #object[clojure.spec.alpha$regex_spec_impl$reify__2509 0x21b8e988 "clojure.spec.alpha$regex_spec_impl$reify__2509@21b8e988"] , :clojure.spec.alpha/value (tupelo.test/fixture-fn [tgt-fn__16599__auto__] ((fn [ctx] (println "*** TEST ONCE *** - enter ")) {:line 25, :column 1}) (tgt-fn__16599__auto__) ((fn [ctx] (println "*** TEST ONCE *** - leave ")) {:line 25, :column 1})), :clojure.spec.alpha/args (tupelo.test/fixture-fn [tgt-fn__16599__auto__] ((fn [ctx] (println "*** TEST ONCE *** - enter ")) {:line 25, :column 1}) (tgt-fn__16599__auto__) ((fn [ctx] (println "*** TEST ONCE *** - leave ")) {:line 25, :column 1}))}

Environment

Ubuntu 16.04
Java 10

Status

Assignee

Unassigned

Reporter

Alan Thompson

Labels

Approval

None

Patch

None

Affects versions

Release 1.10
Release 1.9

Priority

Minor