Wrong line number reported when warning about undeclared Var


  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Environment:
    Windows 7 Home Premium 64 bit, Leiningen 2.1.2 on Java 1.7.0_05 Java HotSpot(TM) 64-Bit Server VM


While using cljsbuild v.3.2 or v.3.3, and cljs v1859, an undeclared
Var error will report the error at the wrong line number (i.e. 11
instead of 6):

(ns example.hello)

(defn foo [a b]
(* a b))

(fooo 2 3)

A cljsbuild "clean" executes normally, but an "auto" yields an error:

C:\Users\Greg\simple - test>lein cljsbuild auto
Compiling ClojureScript.
Compiling "resources/public/js/main.js" from ["src-cljs"]...
WARNING: Use of undeclared Var example.hello/fooo at line 11 src-cljs\example\hello.cljs
←[32mSuccessfully compiled "resources/public/js/main.js" in 15.988207202 seconds.←[0m

When I deliberately create other undeclared Var
errors further down in the file, the line number discrepancies become
even larger.

I changed ClojureScript dependencies to isolate the problem. The wrong
line number errors seem to begin with cljs v0.0-1853. v1847 seems to work correctly. Minimal reproducing case
follows in the attachments.

  1. hello.cljs
    05/Oct/13 8:52 PM
    0.1 kB
    Greg Wanish
  2. project.clj
    05/Oct/13 8:52 PM
    0.6 kB
    Greg Wanish



Vote (0)
Watch (1)


  • Created: