Because the -main
function has more than one implementation, you need to explicitly use the function type, Fn
, instead of the short syntax. It would look something like this:
(ann -main
(Fn [-> nil]
[Any -> nil]))
Take a look at the Functions entry, in the core.typed wiki, for more details on the syntax of the function type. Also, take a look at cf
, because it can show you how to type forms.
(clojure.core.typed/cf
(fn ([] (println "Hello, World!"))
([x] (println "You gave me " x))))
;; => [(Fn [Any -> nil] [-> nil]) {:then tt, :else ff}]