(ns geyser.rabbitmq (:require [langohr.core :as rmq] [langohr.channel :as lch] [langohr.basic :as lb] [clojure.core.typed :as t]))
(t/defalias ^:private rmq_options (t/HMap :optional {:host t/Str :port t/Int :username t/Str :password t/Str :vhost t/Str :ssl t/Bool :ssl-context t/Any :authentication-mechanism t/Any :executor t/Any}))
(t/ann langohr.core/connect [rmq_options -> t/Any])(t/ann langohr.channel/open [t/Any -> t/Any])(t/ann langohr.basic/publish [t/Any t/Str t/Any -> t/Nothing])
(t/ann rabbitmq-sender! [t/Str rmq_options (t/Fn [t/Int -> (t/Vec t/Str)]) -> (t/Fn [t/Int -> t/Nothing])])(defn rabbitmq-sender! [exchange config messages] (let [connection (rmq/connect config) chan (lch/open connection)] (t/ann-form (fn [n] (dorun (map #(lb/publish chan "" %) (messages n)))) (t/Fn [t/Int -> t/Nothing]))))
Building core.typed base environments ...
Finished building base environments"Elapsed time: 10482.354066 msecs"core.typed initialized.Start collecting geyser.rabbitmqFinished collecting geyser.rabbitmqCollected 1 namespaces in 536.271041 msecsNot checking langohr.core (does not depend on clojure.core.typed)Not checking clojure.core.typed (does not depend on clojure.core.typed)Not checking langohr.basic (does not depend on clojure.core.typed)Not checking langohr.channel (does not depend on clojure.core.typed)Start checking geyser.rabbitmqType Error (geyser/rabbitmq.clj:30:18) Internal Error (geyser/rabbitmq.clj:30:18) First argument to TApp must be TFn, actual: FnType Checker: Found 1 errorFound errorsSubprocess failed
I also get something similar, and don't understand how TApp/TFn relates my code.(ns manifold.core.directories"Functions that return the parts of the Manifold standarddirectory structure. These are all illumina-specific"(:require[environ.core :refer [env]][clojure.core.typed :refer [ann cf check-ns U Map Keyword Fn tc-ignore]][clojure.tools.logging :as log][me.raynes.fs :as fs]))(ann ^:no-check environ.core/env (Map Keyword String))(ann ^:no-check me.raynes.fs/file (Fn [(U java.io.File String) (U java.io.File String) * -> java.io.File]))
(ann manifold [-> java.io.File])(defn manifold"Retrieves the base Manifold data directory from the environment variableMANIFOLD_DATA_DIR. If this variable is not set, throws an exception."[](let [p (env :manifold-data-dir)](if (nil? p)(let [msg "Missing MANIFOLD_DATA_DIR environment variable"](tc-ignore (log/error msg))(throw (Exception. msg)))(fs/file p))))Result of type checking...$lein typed checkInitializing core.typed ...
Building core.typed base environments ...Finished building base environments
"Elapsed time: 4023.466697 msecs"core.typed initialized.Start collecting manifold.core.process-idsFinished collecting manifold.core.process-idsStart collecting manifold.core.directoriesFinished collecting manifold.core.directoriesCollected 2 namespaces in 947.822073 msecs
Not checking clojure.core.typed (does not depend on clojure.core.typed)
Start checking manifold.core.process-idsChecked manifold.core.process-ids in 773.500626 msecsNot checking me.raynes.fs (does not depend on clojure.core.typed)Not checking clojure.tools.logging (does not depend on clojure.core.typed)Not checking environ.core (does not depend on clojure.core.typed)Start checking manifold.core.directoriesType Error (manifold/core/directories.clj:26:7) Internal Error (manifold/core/directories.clj:26:7) First argument to TApp must be TFn, actual: Fn
Type Checker: Found 1 errorFound errorsSubprocess failed
Many other calls to (fs/file ...) in this module seem to type-check just fine.Using clojure 1.7.0 and core.typed 0.3.9Thanks,Chris