tools.reader

:column metadata for sets should be an int

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • 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.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: