Uploaded image for project: 'tools.reader'
  1. TRDR-22

:column metadata for sets should be an int

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Completed
    • Labels:
      None
    • Environment:

      Clojure 1.5.0 / Clojure 1.5.1
      Java 1.8.0_05

    • Patch:
      Code

      Description

      (->> "#{1 2 3 4}"
           clojure.tools.reader.reader-types/indexing-push-back-reader
           clojure.tools.reader/read
           meta
           (map #(vector (key %) (val %) (type (val %)))))
      
      ([:end-column 11 java.lang.Integer]
       [:end-line 1 java.lang.Integer]
       [:column 1 java.lang.Long]
       [:line 1 java.lang.Integer])
      

      Trying to eval the result of the above causes the compiler to throw: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer. This only affects Clojure 1.5.0 and Clojure 1.5.1.

      The attached patch, 0001-TRDR-22-column-metadata-for-sets-should-be-an-int.patch, adds a call to int in read-set to ensure that the :column metadata is an int.

        Attachments

          Activity

            People

            • Assignee:
              bronsa Nicola Mometto
              Reporter:
              cichli Michael Griffiths
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: