clojure.spec/multi-spec ignores the multimethod hierarchy

Description

Minimal example:

Also fails with the default hierarchy. Worked fine in alpha1, broken in alpha2 and alpha3.

Cause: The implementation of multi-spec uses a predicate that invokes the dispatch function, then looks up the result in the method table. However this does not leverage the actual logic used in multimethods for hierarchy resolution.

Approach: Replace the lookup in the method table with a call to getMethod(), which will use the same lookup logic that multimethod uses.

Patch: clj-1935.patch

Environment

None

Attachments

2

Activity

Show:

Alex MillerSeptember 6, 2016 at 7:41 PM

dval was and is correct, I think? it's just the means of looking up a match for the dispatch value.

Rich HickeySeptember 6, 2016 at 6:20 PM

dval should change similarly

Completed

Details

Assignee

Reporter

Approval

Ok

Patch

Code

Priority

Affects versions

Fix versions

Created May 28, 2016 at 6:43 PM
Updated September 7, 2016 at 9:48 PM
Resolved September 7, 2016 at 9:48 PM