-
-
Save mybuddymichael/0187fa3dcd7ce79e7e0d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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=> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment