Welcome! Please see the About page for a little more info on how this works.

0 votes
in Spec by

Problem: multi-spec does generate retag values on its own from values for which methods have been implemented. However a user can have purposefully speced the retag key differently and multi-spec will generate incompatible values (resulting in a such-that failure). An example is hierarchy dispatch where methods dispatch values aren't necessarily the valid tag values.

Proposed solution: When generating the retag value, multi-spec should first try the existing spec for that key and generate "such-that" it is a possible dispatch value for the multimethod, only generate direclty from the multimethod based mechanism iff there is no spec for the tag key.

2 Answers

0 votes
by

Comment made by: lgs32a

Improved proposed solution to cover both "user spec is a subset of dispatch values" and vice versa.

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-2158 (reported by lgs32a)
...