Comments (8)
That was a typo. Writing extend
is simple.
from clj-kondo.
I think we could improve the error message to say that the class name must be a simple symbol
from clj-kondo.
You can't officially use (Class/forName "[B")
with extend-protocol
.
Only class names are allowed, not expressions. That it works is accidental. In this case it's better to write the extend
call manually. I can give links where this is discussed later on. One of the issues with doing what you do above is that it becomes unreliable when you have multiple expressions like that.
from clj-kondo.
I see, did not know that!
better to write the extend call or simply (?)
I'd like to know what "simply" is here cause I like simple :)
from clj-kondo.
In Clojure 1.12 you will be able to write (extend-protocol IFoo byte* ...)
from clj-kondo.
Here is the relevant JIRA: https://clojure.atlassian.net/browse/CLJ-1381
Slack discussion: https://clojurians.slack.com/archives/CHY97NXE2/p1677266201633939
from clj-kondo.
Also see https://clojure.atlassian.net/browse/CLJ-2836
from clj-kondo.
I'll leave this issue open until CLJ-2836 is resolved.
from clj-kondo.
Related Issues (20)
- Support s/defprotocol from prismatic schema
- `clj-kondo` appears to give type-mismatch error for code that runs without errors on JVM Clojure HOT 1
- Requiring the current namespace with an alias isn't marked as unused HOT 6
- discouraged-ns does not use the level correctly
- @inc should warn with type error
- Ability to fail linting if clj-kondo is outdated HOT 7
- Performance: code that analyzes fn bindings is ran twice
- New linter — `:redundant-ignore` HOT 1
- Incorrect "unused value" warning on list with maps
- Unresolved symbol in tablecloth/let-dataset function HOT 3
- metadata configs on macros (e.g. lint-as) aren't copied during the the copy-configs phase
- Handle `not` in `:condition-always-true` / new linter - `:condition-always-false` HOT 6
- Detect incorrectly positioned return schema HOT 3
- Suppress `:unused-binding` linter in first argument of class method arglists HOT 3
- Quality of life improvements for macroexpand-hook developers HOT 3
- Report language in cljc lint errors HOT 1
- warning: Unresolved var: gen/fmap in cljc files
- Incorrect reporting of unused bindings after 4th function in letfn binding HOT 3
- Expose node ancestors in hook api HOT 4
- Running clj-kondo with --parallel sometimes produce different caches HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clj-kondo.