Guest User

Untitled

a guest
Mar 13th, 2013
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (ns typed.test
  2.   (:require [clojure.core.typed :refer [ann check-ns tc-ignore]]))
  3. (tc-ignore
  4.  (defrecord R [v]))
  5.  
  6. (ann nop [(IPersistentMap Any Any) -> (IPersistentMap Any Any)])
  7. (defn nop [m] m)
  8.  
  9. (ann r R)
  10. (def r (R. 1))
  11.  
  12. (nop r)
  13.  
  14. ;; Running (check-ns) on this gives:
  15. ;; AssertionError Assert failed: 16: Wrong number of arguments passed to polymorphic type: (All [a] (clojure.lang.IPersistentCollection a))[]
  16. (= (:nbound t) (count types))  clojure.core.typed/instantiate-poly (type_rep.clj:477)
Advertisement
Add Comment
Please, Sign In to add comment