(from
https://groups.google.com/d/msg/clojure-core-typed/4z_7WnqZsyI/53jlUHQfWhEJ)
The following code:
(t/ann new-ar (t/All [[m :< (t/Map t/Any t/Any)]] [m -> (t/Assoc m ':id Number ':version Number)]))
(defn new-ar
[detail]
{:post [(not (nil? (:id %)))
(zero? (:version %))]}
(assoc detail :id 10 :version 0))
gives the following error:
Type Error (qfi/health/core/domain/model/common.clj:40:3) Cannot assoc args `[(clojure.core.typed/Val :id) {:then tt, :else ff}] [(clojure.core.typed/Val 10) {:then tt, :else ff}] [(clojure.core.typed/Val :version) {:then tt, :else ff}] [(clojure.core.typed/Val 0) {:then tt, :else ff}]` on m
in: (assoc detail :id 10 :version 0)