Skip to content
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

Malli generates incorrect clj-kondo spec for :fn schemas #836

Closed
camsaul opened this issue Feb 2, 2023 · 3 comments · Fixed by #987
Closed

Malli generates incorrect clj-kondo spec for :fn schemas #836

camsaul opened this issue Feb 2, 2023 · 3 comments · Fixed by #987

Comments

@camsaul
Copy link

camsaul commented Feb 2, 2023

Contrived example:

(mx/defn x [y :- [:fn vector?]]
  y)

(x [:x])
;; => Expected function, received vector

The generated Kondo fig is incorrect:

{x {:arities {1 {:args [:fn], :ret :any}}}}

Related: #826

@opqdonut
Copy link
Member

opqdonut commented Mar 7, 2023

This should get fixed by #851

@Yutsa
Copy link

Yutsa commented Apr 12, 2023

I think I have an issue related to this, I tried to specify data with a predicate and clj-kondo believes I should provide a function but my predicate checks if it is a string starting with "SKU-". If it can't infer that the type is a string it could at least type it to any right ?

image

@juszczakn
Copy link
Contributor

FYI ran into this myself lately, took a stab at fixing this w/ #987 .

ikitommi added a commit that referenced this issue Jan 7, 2024
Fix #836 clj-kondo linter generation when using pred :fn's
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants