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

Multi-arity function instrumentation fails with :static-fns true

Description

The following code, in a cljc file, will pass all tests in Clojure, as well as ClojureScript with :optimizations :none, but will fail the second assertion when :optimizations :advanced is enabled.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 (ns cljs-arity-spec-issue.core-test (:require #?@(:clj [[clojure.test :refer :all] [clojure.spec.alpha :as s] [clojure.spec.test.alpha :as st]] :cljs [[cljs.test :refer-macros [deftest testing is use-fixtures]] [cljs.spec.alpha :as s] [cljs.spec.test.alpha :as st]]))) (defn arities ([a] (inc a)) ([a b] (+ a b)) ([a b c] 0)) (s/fdef arities :args (s/or :arity-1 (s/cat :a number?) :arity-2 (s/cat :a number? :b number?) :arity-3 (s/cat :a string? :b boolean? :c map?)) :ret number?) (st/instrument) (deftest arities' (testing "Arity-1 Positive" (is (arities 1))) (testing "Arity-1 Negative" (is (thrown? #?(:clj RuntimeException :cljs :default) (arities "bad"))))) ; This test fails with :advanced enabled

Environment

GNU/Linux

Status

Assignee

Mike Fikes

Reporter

import

Labels

Approval

None

Patch

Code

Priority

Minor