Could this be linted?
(defprotocol Bar
(bar [_ x]))
(defrecord foo [x]
Bar)
(bar (->foo 1) 1) ;; explodes
So basically a warn (or error) on missing implementation of protocol-fn?I think it could
I think I found a false positive with clj-kondo. something.cljc
(let [lname "hello-world"
gfullname #?(:bb nil
:clj (symbol (str (ns-name *ns*) "." lname)))
gclass #?(:bb nil
:clj (println gfullname)
:cljs nil)])
❯ clj-kondo --lint something.cljc
something.cljc:1:6: error: let binding vector requires even number of forms
something.cljc:1:7: warning: unused binding lname
something.cljc:2:7: warning: unused binding gfullname
something.cljc:4:7: warning: unused binding gclass
something.cljc:4:7: error: Unresolved symbol: gclass
something.cljc:6:23: error: unsupported binding form nil
linting took 35ms, errors: 3, warnings: 3
Can someone reproduce it as well? clj-kondo v2021.05.31Btw, you can use :default
to target (not :clojure)
:
#?(:clj (symbol …)
:default nil)
have you tried to run it? ;)
especially in CLJS it should not work
cljs.user=> (load-file "/tmp/something.cljc")
Unexpected error (ExceptionInfo) macroexpanding cljs.core$macros/let at (<cljs repl>:1:1).
let requires an even number of forms in binding vector
Oh 😂 My bad! I have tried java/bb 😄
do you want to run this file in CLJS as well btw?
In some time probably yes
ok
@slipset feel free to create an issue
Will do!