speced.def icon indicating copy to clipboard operation
speced.def copied to clipboard

Support more than one function literal

Open vemv opened this issue 5 years ago • 1 comments

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)

vemv avatar Mar 26 '19 06:03 vemv

^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)

vemv avatar Apr 08 '19 14:04 vemv