Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (ns typed.test
- (:require [clojure.core.typed :refer [ann check-ns tc-ignore]])
- (:import [clojure.lang IPersistentMap]))
- (tc-ignore
- (defrecord R [v]))
- (ann nop [(IPersistentMap Any Any) -> (IPersistentMap Any Any)])
- (defn nop [m] m)
- (ann r R)
- (def r (R. 1))
- (nop r)
- ;; Running (check-ns) on this gives:
- ;; AssertionError Assert failed: 16: Wrong number of arguments passed to polymorphic type:
- ;; (All [a] (clojure.lang.IPersistentCollection a))[]
- ;; (= (:nbound t) (count types)) clojure.core.typed/instantiate-poly (type_rep.clj:477)
Advertisement
Add Comment
Please, Sign In to add comment