Fork me on GitHub
#clj-kondo
<
2022-08-06
>
borkdude08:08:08

You can verify this yourself in a REPL:

user=> AutoCloseable
Syntax error compiling at (REPL:0:0).

pinkfrog09:08:31

I have the general impression that all things under java.lang are directly accessible. Why here isn’t the caes?

pinkfrog09:08:55

For example, Object and Thread from java.lang are directly accessible.

borkdude09:08:26

This is not the case for everything

pinkfrog09:08:00

yes. might be class only:

borkdude09:08:29

Don't complain to me, this is just not the case for all classes as you can verify in a REPL. This is not a kondo problem. Take it up with the people who wrote those docs.

borkdude09:08:47

user=> java.lang.ProcessHandle
java.lang.ProcessHandle
user=> ProcessHandle
Syntax error compiling at (REPL:0:0).
Unable to resolve symbol: ProcessHandle in this context

borkdude09:08:09

Kondo just tells you what is the case, it's not going to change your Clojure implementation for you :)

pinkfrog09:08:33

No complain. It just breaks my previous impression with what’s automatically accessible.

borkdude09:08:21

it's a fixed list which isn't updated

thanks3 1
Alex Miller (Clojure team)12:08:54

That auto import list hasn't been updated in a while - we have a ticket for it.

Alex Miller (Clojure team)12:08:56

They've added so much stuff, I'm not sure that we will want to add everything when we do update it

borkdude13:08:16

I'd be fine with not adding anything to that and being explicit about imports

👍 1
Alex Miller (Clojure team)13:08:07

Yeah, it needs some analysis, just haven't gotten around to doing it

borkdude13:08:30

I wonder if there are potential breakages if someone has already imported foo.bar.ProcessHandle and then adding java.lang.ProcessHandle as an auto-import

Alex Miller (Clojure team)13:08:22

Yeah, stuff like that is something I worry about

Alex Miller (Clojure team)13:08:55

Same kind of problem as adding new stuff to core with auto refers