-
-
Notifications
You must be signed in to change notification settings - Fork 297
Open
Description
- I have read the Clojure etiquette and will respect it when communicating on this platform.
version
clj-kondo v2026.01.19
platform
Native binary, Linux AMD64.
editor
Command line.
problem
Calling a Java class constructor is not considered as interop wrt. the :warn-on-reflection linter.
repro
Happy path, interop is detected due to (Date/from bar).
echo '(ns foo (:import [java.util Date])) (def bar []) (Date/from bar)' | clj-kondo --config '{:linters {:warn-on-reflection {:level :warning}}}' --repro --debug --lint -
[clj-kondo] Linting file: <stdin>
<stdin>:1:51: warning: Var *warn-on-reflection* is not set in this namespace.
linting took 3ms, errors: 0, warnings: 1Sad path, interop is not detected even though we call (Date. bar).
echo '(ns foo (:import [java.util Date])) (def bar []) (Date. bar)' | clj-kondo --config '{:linters {:warn-on-reflection {:level :warning}}}' --repro --debug --lint -
[clj-kondo] Linting file: <stdin>
linting took 6ms, errors: 0, warnings: 0config
{:linters {:warn-on-reflection {:level :warning}}}expected behavior
echo '(ns foo (:import [java.util Date])) (def bar []) (Date. bar)' | clj-kondo --config '{:linters {:warn-on-reflection {:level :warning}}}' --repro --debug --lint -
[clj-kondo] Linting file: <stdin>
<stdin>:1:51: warning: Var *warn-on-reflection* is not set in this namespace.
linting took 3ms, errors: 0, warnings: 1Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
High priority (next release)