We're updating the issue view to help you get more done. 

Stack error in recur

Description

1 2 3 4 5 user> (loop [acc 0 col (range 50)] (if-not (empty? col) (recur (+ acc (first col)) (rest col)) acc))

Generates exception

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 expected: (= (apply + (range 50)) (e/eval (quote (loop [acc 0 col (range 50)] (if-not (empty? col) (recur (+ acc (first col)) (rest col)) acc))))) actual: java.lang.VerifyError: Bad type on operand stack Exception Details: Location: clojure/tools/emitter/passes/jvm/annotate_internal_name$fn__8917.invoke()Ljava/lang/Object; @4: invokestatic Reason: Type 'java/lang/Number' (current frame, stack[0]) is not assignable to long_2nd Current Frame: bci: @4 flags: { } locals: { 'clojure/tools/emitter/passes/jvm/annotate_internal_name$fn__8917' } stack: { 'java/lang/Number' } Bytecode: 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)

Environment

None

Status

Assignee

Nicola Mometto

Reporter

Reid D McKenzie

Labels

None

Approval

None

Patch

None

Priority

Critical