1. create a new leinigen project:
    lein new foo

2. modify foo.core.clj as follow:
 (ns foo.core)
 (defn format [] 1)

3. modify project.clj, add foo.core to aot:
(defproject foo "1.0.0-SNAPSHOT"
  :description "FIXME: write description"
  :dependencies [[org.clojure/clojure "1.3.0"]]
  :aot [foo.core])

4. lein compile will throw exception

Compiling foo.core
WARNING: format already refers to: #'clojure.core/format in namespace:
foo.core, being replaced by: #'foo.core/format
Exception in thread "main" java.lang.NullPointerException
        at clojure.lang.Compiler$ObjExpr.emitVar(Compiler.java:4728)
        at clojure.lang.Compiler$DefExpr.emit(Compiler.java:395)
        at clojure.lang.Compiler.compile1(Compiler.java:6984)
        at clojure.lang.Compiler.compile(Compiler.java:7046)
        at clojure.lang.RT.compile(RT.java:385)
        at clojure.lang.RT.load(RT.java:425)
        at clojure.lang.RT.load(RT.java:398)
        at clojure.core$load$fn__4610.invoke(core.clj:5386)
        at clojure.core$load.doInvoke(core.clj:5385)
        at clojure.lang.RestFn.invoke(RestFn.java:408)
        at clojure.core$load_one.invoke(core.clj:5200)
        at clojure.core$compile$fn__4615.invoke(core.clj:5397)
        at clojure.core$compile.invoke(core.clj:5396)
        at user$eval31.invoke(NO_SOURCE_FILE:1)
        at clojure.lang.Compiler.eval(Compiler.java:6465)
        at clojure.lang.Compiler.eval(Compiler.java:6455)
        at clojure.lang.Compiler.eval(Compiler.java:6431)
        at clojure.core$eval.invoke(core.clj:2795)
        at clojure.main$eval_opt.invoke(main.clj:296)
        at clojure.main$initialize.invoke(main.clj:315)
        at clojure.main$null_opt.invoke(main.clj:348)
        at clojure.main$main.doInvoke(main.clj:426)
        at clojure.lang.RestFn.invoke(RestFn.java:421)
        at clojure.lang.Var.invoke(Var.java:405)
        at clojure.lang.AFn.applyToHelper(AFn.java:163)
        at clojure.lang.Var.applyTo(Var.java:518)
        at clojure.main.main(main.java:37)
Compilation failed.

If I change the function name "format" to other things like "format1",
then compile will succeed.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to