This code is producing an error in the type checker. Seems to have to do with the Math/abs call.
(t/ann foo [t/Int :-> t/Str])
(defn foo [cents]
(str (Math/abs cents)))
Execution error (AssertionError) at typed.cljc.checker.check.utils/Type->Class (utils.clj:495).
Assert failed: (r/Type? t)
Is there something wrong with the code or does it look like a bug?Seems clojure's abs function works but not Math/abs
Looks like a bug.
But you probably need to add a type hint for it to type check.
^long cents
That might circumvent the bug.
If it fixes it, please file a report. And yes, clojure.core/abs is better here.