octet icon indicating copy to clipboard operation
octet copied to clipboard

nesting multiple non-dynamic specs containing dynamic spec fails

Open meeseekz opened this issue 4 years ago • 0 comments

This works (spec (vector* ubyte)) but adding another spec layer breaks it: (spec (spec (vector* ubyte)))

Exception: java.lang.IllegalArgumentException: No implementation of method: :size of protocol: #'octet.spec/ISpecSize found for class: octet.spec.collections$vector_STAR_$reify__5878

A quick fix seems to be changing the propagation of size to prioritize size* when available: https://github.com/funcool/octet/blob/6afe46d98717e5a538c97c5445a29686524bd0c9/src/octet/spec.cljc#L122

meeseekz avatar Jan 30 '20 23:01 meeseekz