clj-commons / potemkin

some ideas which are almost good
577 stars 53 forks source link

NullPointer on call to keys of empty def-map-type #22

Closed savagematt closed 10 years ago

savagematt commented 10 years ago
(def-map-type
    TestMap [m]
    (get [this k default-value]
         (get m k default-value))

    (assoc [this key value]
        (throw (UnsupportedOperationException.)))

    (dissoc [this key]
            (throw (UnsupportedOperationException.)))

    (keys [this]
          (keys m)))

(keys (TestMap. {}))
savagematt commented 10 years ago

Unable to reproduce on head. Think this might have been fixed some time between 0.3.4 and now.