Clojure

Add filename and line number to defn parameter declaration error

Details

  • Type: Enhancement Enhancement
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: Release 1.4, Release 1.5
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Environment:
    Windows
  • Patch:
    Code
  • Approval:
    Triaged

Description

When mistyping parameter list in defn declaration, e.g.

(defn test
(some-error))

error message shows name of parameter (without quotes), but not function name, filename or line number:

Exception in thread "main" java.lang.IllegalArgumentException: Parameter declaration some-error should be a vector
at clojure.core$assert_valid_fdecl.invoke(core.clj:6567)
at clojure.core$sigs.invoke(core.clj:220)
at clojure.core$defn.doInvoke(core.clj:294)
at clojure.lang.RestFn.invoke(RestFn.java:467)
at clojure.lang.Var.invoke(Var.java:427)
at clojure.lang.AFn.applyToHelper(AFn.java:172)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.lang.Compiler.macroexpand1(Compiler.java:6366)
at clojure.lang.Compiler.macroexpand(Compiler.java:6427)
at clojure.lang.Compiler.eval(Compiler.java:6495)
at clojure.lang.Compiler.load(Compiler.java:6952)
at clojure.lang.Compiler.loadFile(Compiler.java:6912)
at clojure.main$load_script.invoke(main.clj:283)
at clojure.main$init_opt.invoke(main.clj:288)
at clojure.main$initialize.invoke(main.clj:316)
at clojure.main$null_opt.invoke(main.clj:349)
at clojure.main$main.doInvoke(main.clj:427)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:419)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.main.main(main.java:37)

  1. 0001-CLJ-1169-proposed-patch.patch
    22/Feb/13 5:39 AM
    2 kB
    Andrei Kleschinski
  2. 0002-CLJ-1169-fix-unit-tests.patch
    01/Mar/13 10:25 AM
    3 kB
    Andrei Kleschinski
  3. defn_error_message.clj
    22/Feb/13 3:25 AM
    0.0 kB
    Andrei Kleschinski

Activity

Hide
Andrei Kleschinski added a comment -

Fix for failed unit-tests

Show
Andrei Kleschinski added a comment - Fix for failed unit-tests
Hide
Andy Fingerhut added a comment -

Patch 0001-CLJ-1169-proposed-patch.patch dated Feb 22 2013 causes several tests to fail. Run "./antsetup.sh" then "ant" to see which ones (or "mvn package").

Show
Andy Fingerhut added a comment - Patch 0001-CLJ-1169-proposed-patch.patch dated Feb 22 2013 causes several tests to fail. Run "./antsetup.sh" then "ant" to see which ones (or "mvn package").
Hide
Andrei Kleschinski added a comment -

Proposed patch for issue
Process exceptions in macroexpand1 and wraps them in CompilerException with source,line,column information.

Also patch adds quotes around invalid symbol name in error message to make them more distinguishable from rest of message.

Show
Andrei Kleschinski added a comment - Proposed patch for issue Process exceptions in macroexpand1 and wraps them in CompilerException with source,line,column information. Also patch adds quotes around invalid symbol name in error message to make them more distinguishable from rest of message.

People

Vote (2)
Watch (0)

Dates

  • Created:
    Updated: