Fork me on GitHub

@alexmiller thanks for fixing CLJ-2427 🙂


I have a query/question about some of the new error messages


If I use a namespace without requiring it, or use an alias without adding it to a require, I get an error which is a syntax error


#error{:cause "",
       :via [{:type clojure.lang.Compiler$CompilerException,
              :message "Syntax error compiling at (<myfile>.clj:127:1).",
              :data #:clojure.error{:phase :compile-syntax-check,
                                    :line 127,
                                    :column 1,
                                    :source "<myfile>.clj"},
              :at [clojure.lang.Compiler load "" 7649]}
             {:type java.lang.ClassNotFoundException,
              :message "",
              :at [ findClass "" 381]}],
       :trace [[ findClass "" 381]
               [clojure.lang.DynamicClassLoader findClass "" 69]


I was surprised that it was a syntax error. I think of syntax errors as problems where the code is not well-formed and is syntactically incorrect


Using a namespace without requiring it seems like an error, but seems like maybe a different class of error?

Alex Miller (Clojure team)20:11:25

yeah, so the Compiler is not very disciplined right now about which exception types it uses

Alex Miller (Clojure team)20:11:36

we have two phases defined - :compile-syntax-check and :compilation


Yeah, was thinking it was more about the phases

Alex Miller (Clojure team)20:11:48

at the moment, everything is being reported as :compile-syntax-check

Alex Miller (Clojure team)20:11:27

but if you look carefully, the Compiler code throws a variety of exception types with no correlation to these two kinds of errors

Alex Miller (Clojure team)20:11:53

this particular case is one where getting a :compilation phase error would make more sense

Alex Miller (Clojure team)20:11:28

and in that case, you should get a different message (I can’t remember but I think the code for that is there already)

Alex Miller (Clojure team)20:11:48

so I have a todo to go through and make the compiler more disciplined about this, but I’m not going to do it for 1.10


k, no JIRA ticket needed then?


or is it a helpful example?

Alex Miller (Clojure team)20:11:15

oh, I should probably make a generic one

Alex Miller (Clojure team)20:11:40

it’s pretty easy to look at the code with this eye and separate

Alex Miller (Clojure team)21:11:35

so I’d rather have one generic ticket than a zillion specific ones


Just re-read my messages, was meant to be a separate statement, not specifically asking for you to look at it


Though I can see how that wasn't very clear


I normally try not to @ mention anyone in specific for a question like that

Alex Miller (Clojure team)21:11:12

I’ve got enough keyword triggers set up that I got a notification on it anyways :)

Alex Miller (Clojure team)21:11:29

and I try to always read this room regardless