clojure-mode icon indicating copy to clipboard operation
clojure-mode copied to clipboard

clojure-add-arity severs arglist metadata

Open loganlinn opened this issue 2 years ago • 0 comments

Expected behavior

Invoking clojure-add-arity in a single-arity function with metadata on the arglist should result in a function that still has that arglist meta.

For example, if I have

(defn string
  ^String
  [x]
  (str x))

After clojure-add-arity, I should have

(defn string
  ([])
  (^String [x]
   (str x)))

Actual behavior

New airty is added between metadata and the existing arglist, consequently moving the metadata off the original arglist. The metadata is no longer meaningful.

(defn string
  ^String
  ([])
  ([x]
   (str x)))

Steps to reproduce the problem

Invoke clojure-add-arity at any point in a single-arity function with metadata on the arglist.

Environment & Version information

clojure-mode version

5.16.0

Emacs version

GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars)

Operating system

NixOS 23.05

loganlinn avatar May 07 '23 21:05 loganlinn