Skip to content

:tag metadata can be wrong #45

@vemv

Description

@vemv

:tag metadata should denote classes or primitives - not arbitrary objects.

However some of the :tags that byte-streams emits can denote byte_streams.graph.Type objects:

(in-ns 'byte-streams)

;; inspect the def-transfer defined at https://github.com/clj-commons/byte-streams/blob/4066d637300c144d37e888c23de1a9c3ae19829a/src/byte_streams.clj#L610 :
(-> '(def-transfer [ReadableByteChannel File]
       [channel file {:keys [chunk-size] :or {chunk-size (int 1e7)} :as options}]
       (let [^FileChannel fc (convert file WritableByteChannel options)]
         (try
           (loop [idx 0]
             (let [n (.transferFrom fc channel idx chunk-size)]
               (when (pos? n)
                 (recur (+ idx n)))))
           (finally
             (.force fc true)
             (.close fc)))))
    macroexpand-1
    last
    second
    second
    meta
    println)

;; {:tag #object[byte_streams.graph.Type 0x62e58f04 java.io.File]}

...this is accurately reported by running lein eastwood.

Fixing this might also solve other tag-related issues that I can see in the tracker.

Hope it helps!

-V

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions