speced.def
speced.def copied to clipboard
Support more than one function literal
speced/defn foo [^some? ^named? lang]
should generate a (spec/and named? lang?)
.
(That should be forbidden for keyword specs)
Currently the behavior is to skip one of the passed specs, which is buggy per se (there's some code that attempted to avoid this. Worth reviewing)
^some? ^named? lang
cannot be prevented with regular clj code, since the issue happens at reader level: ^{:tag some?} ^{:tag named} lang
. The two maps will be merged, and one will 'lose'.
^::some? ^::named?
can be fixed though - doing.
In a future, some kind of linter could prevent ^some? ^named? lang
(which also is generally desirable: e.g. regular Clojure code may have this bug ^String ^Long x
)