This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-09-14
Channels
- # announcements (1)
- # beginners (85)
- # calva (23)
- # cider (3)
- # clj-kondo (33)
- # cljs-dev (12)
- # clojure (79)
- # clojure-dev (5)
- # clojure-europe (1)
- # clojure-nl (3)
- # clojure-uk (3)
- # clojurescript (5)
- # clojutre (2)
- # data-science (30)
- # datomic (3)
- # duct (7)
- # fulcro (8)
- # garden (18)
- # jackdaw (2)
- # leiningen (1)
- # off-topic (3)
- # pathom (4)
- # qa (24)
- # re-frame (13)
- # reagent (3)
- # shadow-cljs (58)
- # testing (1)
#qa
<
2019-09-14I implemented some local type checking / inference in clj-kondo. Any volunteers for testing?
demo: https://twitter.com/borkdude/status/1172628472273035265
You can test by checking out https://github.com/borkdude/clj-kondo at the typing
branch and lint random code using:
clojure -A:clj-kondo --lint <your-code> | grep Expected
The grep takes care of only displaying the type errors that clj-kondo found. Please report any false positives you may find in the smallest repro possible.Issue where you might report findings: https://github.com/borkdude/clj-kondo/issues/445
i tried running it against clojure's source and i see some errors under the test directory -- should i report those?
clojure/test/clojure/test_clojure/data_structures.clj:1130:44: error: Expected: seqable collection, received: nil.
clojure/test/clojure/test_clojure/logic.clj:109:14: error: Expected: seqable collection, received: nil.
clojure/test/clojure/test_clojure/sequences.clj:110:16: error: Expected: seqable collection, received: nil.
clojure/test/clojure/test_clojure/sequences.clj:173:49: error: Expected: seqable collection, received: positive integer.
clojure/test/clojure/test_clojure/sequences.clj:175:13: error: Expected: seqable collection, received: nil.
clojure/test/clojure/test_clojure/sequences.clj:176:15: error: Expected: seqable collection, received: nil.
clojure/test/clojure/test_clojure/sequences.clj:178:14: error: Expected: seqable collection, received: nil.
clojure/test/clojure/test_clojure/sequences.clj:822:14: error: Expected: seqable collection, received: nil.
clojure/test/clojure/test_clojure/serialization.clj:55:13: error: Expected: seqable collection, received: nil.
Seems relevant :-). Just one of those nil examples should be fine, would be nice if you could get it down to a small example
i think it's in here:
(deftest ordered-collection-equality-test
(let [empty-colls [ []
'()
(lazy-seq)
clojure.lang.PersistentQueue/EMPTY
(vector-of :long) ]]
(doseq [c1 empty-colls, c2 empty-colls]
(is-same-collection c1 c2)))
(let [colls1 [ [-3 :a "7th"]
'(-3 :a "7th")
(lazy-seq (cons -3
(lazy-seq (cons :a
(lazy-seq (cons "7th" nil)))))) ; <-------- this line is 1130
(into clojure.lang.PersistentQueue/EMPTY
[-3 :a "7th"])
(sequence (map identity) [-3 :a "7th"]) ]]
(doseq [c1 colls1, c2 colls1]
(is-same-collection c1 c2)))
(is-same-collection [-3 1 7] (vector-of :long -3 1 7)))