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

Clojure loses quoted metadata on empty literals

Description

meta on empty collections is lost:

1 2 3 4 user=> (meta '^:foo []) nil ;; expected {:foo true} as in: user=> (meta '^:foo [1]) {:foo true}

This bug propagates to ^:const vars:

1 2 3 4 5 6 user=> (def ^:const foo ^:foo []) #'user/foo user=> (meta foo) nil user=> (meta @#'foo) {:foo true}

Cause: As in CLJ-1093, empty collections are replaced with an EmptyExpr that loses meta

Proposed: Don't replace with EmptyExpr if meta is present.

Patch: 0001-Support-retrieval-of-metadata-from-quoted-empty-lite.patch

Screened by:

Environment

None

Status

Assignee

Unassigned

Reporter

Nicola Mometto

Approval

Vetted

Patch

Code and Test

Fix versions

Affects versions

Release 1.10

Priority

Minor