Skip to content

data_readers merging can produce duplicate keys, making the merged file unreadable #55

@imrekoszo

Description

@imrekoszo

Affects 1.3.0 and 1.4.0

Looks like this change can create unreadable code when multiple data readers maps have the same key. In fact, the examples in the test appear to be unreadable (note the duplicate common keys):

{project-a a
 common A
 project-b #?{:clj clj-b :cljs cljs-b}
 #?@{:clj [clj-only clj]}
 #?@{:cljs [cljs-only cljs]}
 common B}

{project-a a
 common A
 project-c c
 common C}

Stumbled upon this after bumping from 1.0.4 to 1.4.0:

clojure.lang.LispReader$ReaderException: java.lang.IllegalArgumentException: Duplicate key: time/period
 	at clojure.lang.LispReader.read(LispReader.java:316)
 	at clojure.lang.LispReader.read(LispReader.java:218)
 	at clojure.lang.LispReader.read(LispReader.java:207)
 	at clojure.core$read.invokeStatic(core.clj:3794)
 	at clojure.core$load_data_reader_file.invokeStatic(core.clj:8047)
...

Originally posted by @imrekoszo in #51

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions