user> (loop [acc 0
col (range 50)]
(if-not (empty? col)
(recur (+ acc (first col)) (rest col))
acc))
产生异常
预期: (= (apply + (range 50)) (e/eval (quote (loop [acc 0 col (range 50)] (if-not (empty? col) (recur (+ acc (first col)) (rest col)) acc)))))
实际: java.lang.VerifyError: Bad type on operand stack
异常详细信息
位置
clojure/tools/emitter/passes/jvm/annotate_internal_name$fn__8917.invoke()Ljava/lang/Object; @4: invokestatic
原因
类型 'java/lang/Number'(当前帧,堆栈[0])无法赋值给 long_2nd
当前帧
bci: @4
flags: { }
locals: { 'clojure/tools/emitter/passes/jvm/annotate_internal_name$fn__8917' }
stack: { 'java/lang/Number' }
字节码
0x0000000: 2ab6 0045 b800 49b0
at java.lang.Class.getDeclaredConstructors0 (Class.java:-2)
java.lang.Class.privateGetDeclaredConstructors (Class.java:2671)
java.lang.Class.getConstructor0 (Class.java:3075)
java.lang.Class.newInstance (Class.java:412)
clojure.tools.emitter.jvm$eval.invoke (clojure/tools/emitter/jvm.clj:105)
clojure.tools.emitter.jvm$eval.invoke (clojure/tools/emitter/jvm.clj:83)
clojure.tools.emitter.jvm.core_test$fn__8193$fn__8328.invoke (core_test.clj:74)
clojure.tools.emitter.jvm.core_test/fn (core_test.clj:73)