SHOW:
|
|
- or go back to the newest paste.
| 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))[] |
| 15 | + | ;; AssertionError Assert failed: 16: Wrong number of arguments passed to polymorphic type: |
| 16 | ;; (All [a] (clojure.lang.IPersistentCollection a))[] | |
| 17 | ;; (= (:nbound t) (count types)) clojure.core.typed/instantiate-poly (type_rep.clj:477) |