Skip to content
Browse files

Fix for ctor reading

  • Loading branch information...
1 parent 488c8e0 commit d9374f90448a4ff52ad83a2b75be2fa520a24db8 @alexcoventry alexcoventry committed with Bronsa Sep 13, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/main/clojure/clojure/tools/reader.clj
View
5 src/main/clojure/clojure/tools/reader.clj
@@ -588,16 +588,17 @@
\{ [\} :extended]
nil)]
(let [entries (to-array (read-delimited end-ch rdr true))
+ numargs (count entries)
all-ctors (.getConstructors class)
ctors-num (count all-ctors)]
(case form
:short
(loop [i 0]
(if (> i ctors-num)
(reader-error rdr "Unexpected number of constructor arguments to " (str class)
- ": got" (count entries))
+ ": got" numargs)
(if (== (count (.getParameterTypes ^Constructor (aget all-ctors i)))
- ctors-num)
+ numargs)
(Reflector/invokeConstructor class entries)
(recur (inc i)))))
:extended

0 comments on commit d9374f9

Please sign in to comment.
Something went wrong with that request. Please try again.