1.2 error message improvement suggestion (missing line #s for some defrecord errors)

9 views
Skip to first unread message

Jason Wolfe

unread,
Jul 30, 2010, 8:38:38 PM7/30/10
to Clojure
I'm converting my ~30Kloc project to 1.2 RC1 from a months-old
snapshot, and so far it's been smooth sailing. One thing I've
noticed, however, is that defrecord "parse error" exceptions seem to
be missing line numbers.

The example I ran into was
user> (defrecord foo [bar] :as this )
; Evaluation aborted.

but I think there may be other similar cases.

Loving the great new features, thanks!

-Jason

Jason Wolfe

unread,
Jul 30, 2010, 9:22:24 PM7/30/10
to Clojure
I guess the line numbers aren't missing, just ... behaving weirdly.

If I make a file "test.clj" with just one line:

(defrecord foo [bar] :as this)

and start up a fresh, bare REPL:

user=> (use 'test)
java.lang.IllegalArgumentException: Unsupported option(s) - :as
(test.clj:1)
user=> (use 'test)
java.lang.IllegalArgumentException: Unsupported option(s) - :as
(test.clj:2)
user=> (use 'test)
java.lang.IllegalArgumentException: Unsupported option(s) - :as
(test.clj:3)
user=> (use 'test)
....

Line numbers for some other exceptions seem to be behaving properly.

-Jason

Jason Wolfe

unread,
Aug 7, 2010, 4:52:56 AM8/7/10
to Clojure
This bug still seems to be present in 1.2 RC2, and is more general
than I previously thought:

jawolfe@[~/Projects/testproj]: cat > src/test.clj


bla
jawolfe@[~/Projects/testproj]: cat > src/test2.clj

(bla)
jawolfe@[~/Projects/testproj]: lein repl
user=> (require 'test)
java.lang.Exception: Unable to resolve symbol: bla in this context
(test.clj:1)
user=> (require 'test)a
java.lang.Exception: Unable to resolve symbol: bla in this context
(test.clj:2)
user=> (require 'test)
java.lang.Exception: Unable to resolve symbol: bla in this context
(test.clj:3)
user=> (require 'test2)
java.lang.Exception: Unable to resolve symbol: bla in this context
(test2.clj:2)
user=> (require 'test2)
java.lang.Exception: Unable to resolve symbol: bla in this context
(test2.clj:2)
user=> (require 'test2)
java.lang.Exception: Unable to resolve symbol: bla in this context
(test2.clj:2)
user=> (require 'test)
java.lang.Exception: Unable to resolve symbol: bla in this context
(test.clj:7)
user=>

-Jason

Stuart Halloway

unread,
Aug 7, 2010, 8:08:35 AM8/7/10
to clo...@googlegroups.com
I don't think this is a regression -- I can see the same thing in 1.1.

Can you please open a ticket, along with any additional information on which kinds of errors do/do not exhibit the problem?

Stu

> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient with your first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

Jason Wolfe

unread,
Aug 7, 2010, 10:48:33 PM8/7/10
to Clojure
OK, done.

http://www.assembla.com/spaces/clojure/tickets/420-some-compiler-exceptions-erroneously-using-repl-line-numbers-

I don't have more details on what kinds of errors are affected; but, I
believe the wrong line numbers are the REPL line numbers, if that
helps..

Thanks, Jason
> > Groups "Clojure" group.> To post to this group, send email tocl...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages