Guest User

Untitled

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