Open opqdonut opened 1 year ago
For case 2, the root cause seems to be a bug in m/-regex-min-max
, which m/-function-info
uses
(m/-function-info (m/schema [:=> [:cat [:schema [:cat :int :string]]] :any]))
==> {:min 2, :arity 2, :input [:cat [:schema [:cat :int :string]]], :output :any, :max 2}
(m/-regex-min-max (m/schema [:cat [:schema [:cat :int :string]]]))
==> {:min 2, :max 2}
A fix for case 2 in #851
Two related issues:
Sequence destructuring generates invalid types. The type for a
[i :- int, s :- string]
destructuring should be[:cat :int :string [:* :any]]
, not[:cat [:? :int] [:? :string] [:* :any]]
which admits any sequenceUsing a
:cat
schema for an argument doesn't work. The:cat
schema for the argument gets combined with the top-level:cat
. This doesn't work even with a[:schema [:cat ..]]
workaround for the argument. However[:tuple ...]
luckily works.Repl session below.