Instrumenting breaks function with varargs

Description

Steps:

Actual:

Expected:

Couldn't reproduce in Clojure 1.9.0 and CLJS 1.9.946.

Environment

CLJS 1.10.238 (also reproducible in Lumo 1.9.0-alpha), 1.10.340

Attachments

5

Activity

Show:

Mike Fikes November 16, 2018 at 5:22 PM

Matt, this is a valid regression relative to 1.10.339. It should involve a new JIRA ticket.

Matthew Huebert November 16, 2018 at 5:19 PM

I am seeing some more unexpected behaviour with `instrument` and varargs, when `:static-fns` is enabled.

With the following repl:
```
clj -Srepro -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version "1.10.439"} org.clojure/test.check {:mvn/version "RELEASE"}}}' -m cljs.main -co '{:static-fns true}' -re node -r
```

and code:
```
(require '[clojure.spec.alpha :as s])
(require '[clojure.spec.test.alpha :as st])

(defn defk
[key & [doc]]
key)

(s/fdef defk
:args (s/cat :key keyword?
:doc (s/? string?)))

(st/instrument)

(defk 1 1)
```

The last line should throw, but doesn't, if `:static-fns` is enabled.

Mike Fikes October 27, 2018 at 9:47 PM

CLJS-2793-2.patch passes f and ret into the macros (instead of employing ~'f and ~'ret).

David Nolen October 27, 2018 at 2:04 PM

First pass I think this looks ok, but lets just pass `ret` instead of capturing it in the macro. I had some trouble following at first because of that.

Completed

Details

Assignee

Reporter

Patch

Code and Test

Priority

Created June 26, 2018 at 1:46 PM
Updated November 16, 2018 at 5:22 PM
Resolved November 16, 2018 at 5:22 PM