SHOW:
|
|
- or go back to the newest paste.
| 1 | (ns typed.test | |
| 2 | (:require [clojure.core.typed :refer [ann check-ns tc-ignore]]) | |
| 3 | - | (:import [clojure.lang IPersistentMap]) |
| 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) |