Skip to content

clojure-add-arity severs arglist metadata #649

Open
@loganlinn

Description

@loganlinn

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions