Skip to content

Instantly share code, notes, and snippets.

@frenchy64 frenchy64/ana.clj
Last active Aug 29, 2015

Embed
What would you like to do?
; [org.clojure/tools.analyzer.jvm "0.1.0-beta4"]
(ns tst.ana
(:require
[clojure.tools.analyzer.jvm :as taj]
[clojure.tools.analyzer.passes.jvm.emit-form :as emit-for m]))
(defn ^:private analyze1 [form env]
(let [a (taj/analyze form env)
frm (emit-form/emit-form a)]
(eval frm)
a))
(analyze1 '(declare foo) (taj/empty-env))
(analyze1
'(do
(defn bar [a]
(foo a))
(defn foo [b]
b))
(taj/empty-env))
CompilerException java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to clojure.lang.IPersistentVector, compiling:(clojure/core/typed/test/tools_analyzer.clj:18:8)
clojure.lang.Compiler.analyzeSeq (Compiler.java:6567)
clojure.lang.Compiler.analyze (Compiler.java:6361)
clojure.lang.Compiler.analyze (Compiler.java:6322)
clojure.lang.Compiler$BodyExpr$Parser.parse (Compiler.java:5708)
clojure.lang.Compiler$FnMethod.parse (Compiler.java:5139)
clojure.lang.Compiler$FnExpr.parse (Compiler.java:3751)
clojure.lang.Compiler.analyzeSeq (Compiler.java:6558)
clojure.lang.Compiler.analyze (Compiler.java:6361)
clojure.lang.Compiler.access$100 (Compiler.java:37)
clojure.lang.Compiler$DefExpr$Parser.parse (Compiler.java:529)
clojure.lang.Compiler.analyzeSeq (Compiler.java:6560)
clojure.lang.Compiler.analyze (Compiler.java:6361)
clojure.lang.Compiler.analyze (Compiler.java:6322)
clojure.lang.Compiler.eval (Compiler.java:6623)
clojure.lang.Compiler.eval (Compiler.java:6608)
clojure.lang.Compiler.eval (Compiler.java:6582)
clojure.core/eval (core.clj:2852)
clojure.core.typed.test.tools-analyzer/analyze1 (tools_analyzer.clj:11)
clojure.core.typed.test.tools-analyzer/eval66187 (tools_analyzer.clj:21)
clojure.lang.Compiler.eval (Compiler.java:6619)
clojure.lang.Compiler.load (Compiler.java:7064)
clojure.lang.RT.loadResourceScript (RT.java:370)
clojure.lang.RT.loadResourceScript (RT.java:361)
clojure.lang.RT.load (RT.java:440)
clojure.lang.RT.load (RT.java:411)
clojure.core/load/fn--5018 (core.clj:5530)
clojure.core/load (core.clj:5529)
clojure.core/load-one (core.clj:5336)
clojure.core/load-lib/fn--4967 (core.clj:5375)
clojure.core/load-lib (core.clj:5374)
clojure.core/apply (core.clj:619)
clojure.core/load-libs (core.clj:5413)
clojure.core/apply (core.clj:619)
clojure.core/require (core.clj:5496)
user/eval66172 (NO_SOURCE_FILE:1)
clojure.lang.Compiler.eval (Compiler.java:6619)
clojure.lang.Compiler.eval (Compiler.java:6582)
clojure.core/eval (core.clj:2852)
clojure.main/repl/read-eval-print--6588/fn--6591 (main.clj:259)
clojure.main/repl/read-eval-print--6588 (main.clj:259)
clojure.main/repl/fn--6597 (main.clj:277)
clojure.main/repl (main.clj:277)
clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn--586 (interruptible_eval.clj:56)
clojure.core/apply (core.clj:617)
clojure.core/with-bindings* (core.clj:1788)
clojure.tools.nrepl.middleware.interruptible-eval/evaluate (interruptible_eval.clj:41)
clojure.tools.nrepl.middleware.interruptible-eval/interruptible-eval/fn--627/fn--630 (interruptible_eval.clj:171)
clojure.core/comp/fn--4154 (core.clj:2330)
clojure.tools.nrepl.middleware.interruptible-eval/run-next/fn--620 (interruptible_eval.clj:138)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1146)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:615)
java.lang.Thread.run (Thread.java:701)
Caused by:
ClassCastException clojure.lang.Symbol cannot be cast to clojure.lang.IPersistentVector
clojure.lang.Compiler$InvokeExpr.parse (Compiler.java:3600)
clojure.lang.Compiler.analyzeSeq (Compiler.java:6562)
clojure.lang.Compiler.analyze (Compiler.java:6361)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.