technomancy/leiningen — Issue #347: `lein run` gives cryptic PersistentList -> String ClassCastException if `:main` namespace is quoted
Author: drewr
Created: 2011-12-05 18:18:56+00:00
State: open

I messed up and put `:main 'foo.bar` in `project.clj` and then saw this. Just seems like we can do better.

% lein run foooo
Exception in thread "main" java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to java.lang.String (NO_SOURCE_FILE:0)
at clojure.lang.Compiler.eval(Compiler.java:5440)
at clojure.lang.Compiler.eval(Compiler.java:5391)
at clojure.core$eval.invoke(core.clj:2382)
at clojure.main$eval_opt.invoke(main.clj:235)
at clojure.main$initialize.invoke(main.clj:254)
at clojure.main$script_opt.invoke(main.clj:270)
at clojure.main$main.doInvoke(main.clj:354)
at clojure.lang.RestFn.invoke(RestFn.java:482)
at clojure.lang.Var.invoke(Var.java:381)
at clojure.lang.AFn.applyToHelper(AFn.java:178)
at clojure.lang.Var.applyTo(Var.java:482)
at clojure.main.main(main.java:37)
Caused by: java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to java.lang.String
at clojure.core$symbol.invoke(core.clj:480)
at leiningen.run$normalize_main.invoke(run.clj:9)
at leiningen.run$run_form.invoke(run.clj:14)
at leiningen.run$run_main.doInvoke(run.clj:24)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:544)
at leiningen.run$run.doInvoke(run.clj:55)
at clojure.lang.RestFn.invoke(RestFn.java:423)
at clojure.lang.Var.invoke(Var.java:369)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.Var.applyTo(Var.java:482)
at clojure.core$apply.invoke(core.clj:542)
at leiningen.core$apply_task.invoke(core.clj:259)
at leiningen.core$_main.doInvoke(core.clj:325)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.core$apply.invoke(core.clj:542)
at leiningen.core$_main.invoke(core.clj:328)
at user$eval291.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:5424)
... 11 more