-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use clj-kondo :seqable
for :+
, :*
, and :?
not {:op :rest}
#952
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,18 @@ | |
|
||
(m/=> siren [:=> [:cat ifn? coll?] map?]) | ||
|
||
(defn clj-kondo-issue-1922-1 [_x]) | ||
(m/=> clj-kondo-issue-1922-1 | ||
[:=> [:cat [:map [:keys [:+ :keyword]]]] :nil]) | ||
|
||
(defn clj-kondo-issue-1922-2 [_x]) | ||
(m/=> clj-kondo-issue-1922-2 | ||
[:=> [:cat [:map [:keys [:* :int]]]] :nil]) | ||
|
||
(defn clj-kondo-issue-1922-3 [_x]) | ||
(m/=> clj-kondo-issue-1922-3 | ||
[:=> [:cat [:map [:keys [:? :string]]]] :nil]) | ||
|
||
(deftest clj-kondo-integration-test | ||
|
||
(is (= {:op :keys, | ||
|
@@ -63,11 +75,27 @@ | |
{'kikka | ||
{:arities {1 {:args [:int], | ||
:ret :int}, | ||
:varargs {:args [:int :int {:op :rest, :spec :int}], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a real varargs case and should generate {:op :rest, :spec :int}. This can be used to match remaining arguments in vararg signatures. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see! Thanks. |
||
:varargs {:args [:int :int :seqable], | ||
:ret :int, | ||
:min-arity 2}}} | ||
'siren | ||
{:arities {2 {:args [:ifn :coll], :ret :map}}}}}] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good tests 💪. |
||
{:arities {2 {:args [:ifn :coll], :ret :map}}} | ||
|
||
'clj-kondo-issue-1922-1 | ||
{:arities {1 {:args [{:op :keys | ||
:req {:keys :seqable}}] | ||
:ret :nil}}} | ||
|
||
'clj-kondo-issue-1922-2 | ||
{:arities {1 {:args [{:op :keys | ||
:req {:keys :seqable}}] | ||
:ret :nil}}} | ||
|
||
'clj-kondo-issue-1922-3 | ||
{:arities {1 {:args [{:op :keys | ||
:req {:keys :seqable}}] | ||
:ret :nil}}}}}] | ||
|
||
#?(:clj | ||
(is (= expected-out | ||
(-> 'malli.clj-kondo-test | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:repeat
is also one of the sequence schemas that can present more than 1 values.