Open triHims opened 7 months ago
this is the way to add types for unannotated functions.
(t/ann clojure.core/line-seq [BufferedReader :-> t/Seqable])
This talk kinda gives me some foundation on how to approach this https://www.youtube.com/watch?v=8oW4Wm09ilk
How to infer types https://www.youtube.com/watch?v=zcxOWE7MuOY
But Still i am not sure ? for these common types can i write them into a seperate file that can be used by entire project ?
Documenting this ticket , in case anyone stumbles upon it.
in your name space declaration you can use
(ns service.job
{:core.typed {:experimental #{:infer-vars}}}
(:gen-class)
)
This will generate annotations for all the functions (Annotations will be of type Any
).
Use ^:no-check
metadata to give an annotation to a function without checking the var.
(t/ann ^:no-check readCsv [...->...])
How to work around missing annotations ?
I have this function. Its not annotated. Frankly i do not want to check it with check-ns but when i run check-ns to check other functions. I get error because line-seq is not found.
ps. I am new to eco system so apologies if its a waste of time.