Uploaded image for project: 'Clojure'
  1. CLJ-1187

Clojure loses quoted metadata on empty literals

    Details

    • Approval:
      Vetted
    • Patch:
      Code and Test

      Description

      meta on empty collections is lost:

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

      This bug propagates to ^:const vars:

      user=> (def ^:const foo ^:foo [])
      #'user/foo
      user=> (meta foo)
      nil
      user=> (meta @#'foo)
      {:foo true}
      

      Cause: As in CLJ-1093 Closed , 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:

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              bronsa Nicola Mometto
            • Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: