secret
Last active

  • Download Gist
core.clj
Clojure
1 2 3 4 5 6 7 8 9 10 11 12
(ns core-typed-tests.core
(:require [clojure.core.typed :as t]))
 
(t/ann-protocol PMaths
mult-by-two [PMaths -> PMaths])
(t/defprotocol> PMaths
(mult-by-two [this]))
 
(t/ann-record SpecialNumber [x := Number])
(defrecord SpecialNumber [x]
PMaths
(mult-by-two [this] (assoc this :x (* (:x this) 2))))
repl
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
core-typed-tests.core=> (t/check-ns)
Initializing core.typed ...
"Elapsed time: 3741.074 msecs"
core.typed initialized.
Start collecting core-typed-tests.core
Finished collecting core-typed-tests.core
Collected 1 namespaces in 3837.122 msecs
Start checking core-typed-tests.core
 
ClassNotFoundException core_typed_tests.core.SpecialNumber java.net.URLClassLoader$1.run (URLClassLoader.java:202)
core-typed-tests.core=> (clojure.repl/pst)
ClassNotFoundException core_typed_tests.core.SpecialNumber
java.net.URLClassLoader$1.run (URLClassLoader.java:202)
java.security.AccessController.doPrivileged (AccessController.java:-2)
java.net.URLClassLoader.findClass (URLClassLoader.java:190)
java.lang.ClassLoader.loadClass (ClassLoader.java:306)
sun.misc.Launcher$AppClassLoader.loadClass (Launcher.java:301)
java.lang.ClassLoader.loadClass (ClassLoader.java:247)
java.lang.Class.forName0 (Class.java:-2)
java.lang.Class.forName (Class.java:171)
clojure.core.typed.utils/symbol->Class (utils.clj:334)
clojure.core.typed.subtype/datatype-ancestors (subtype.clj:881)
clojure.core.typed.subtype/subtype-datatype-and-protocol (subtype.clj:952)
clojure.core.typed.subtype/subtypeA*/fn--10864 (subtype.clj:439)
nil
core-typed-tests.core=>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.