Guest User

Untitled

a guest
Mar 13th, 2013
74
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.   (:import [clojure.lang IPersistentMap]))
  4.  
  5. (tc-ignore
  6.  (defrecord R [v]))
  7.  
  8. (ann nop [(IPersistentMap Any Any) -> (IPersistentMap Any Any)])
  9. (defn nop [m] m)
  10.  
  11. (ann r R)
  12. (def r (R. 1))
  13.  
  14. (nop r)
  15.  
  16. ;; Running (check-ns) on this gives:
  17. ;; AssertionError Assert failed: 16: Wrong number of arguments passed to polymorphic type:
  18. ;; (All [a] (clojure.lang.IPersistentCollection a))[]
  19. ;; (= (:nbound t) (count types))  clojure.core.typed/instantiate-poly (type_rep.clj:477)
Advertisement
Add Comment
Please, Sign In to add comment