So I am trying to define a type for a pair, the first is a boolean the second might be a map, e.g. [true {}].
The following REPL shows my experiments:
(t/defalias BaseValidationSchema
'[java.lang.Boolean (t/HMap :complete? false)])
=> nil
(t/cf [true {}] BaseValidationSchema)
Type Error (NO_SOURCE_FILE) Internal Error (:<NO LINE>) Wrong number of arguments passed to type function. Expected 1, actual 2: clojure.core.typed/Vec [java.lang.Boolean (clojure.core.typed/HMap :mandatory {})]
ExceptionInfo Type Checker: Found 1 error clojure.core/ex-info (core.clj:4403)
(t/cf [true {}] '[java.lang.Boolean (t/HMap :complete? false)])
=> [(t/HVec [true (t/HMap :complete? true)]) {:then tt, :else ff}]
(I know that :complete? is false by default but I am being explicit ;)).
Can somebody explain what I am doing wrong please and the right way to do this?
Thanks!