Clojure - Reflection Warning with primitive array .length

Viewed 381

I'm having some trouble trying to use instance methods on a java float array in clojure. Specifically, the following code gives a reflection warning on the call to .length

(defn make-matrix
  ([^floats fs]
   (let [len-fs (.length fs)]
     (cond (>= len-fs 16) (Matrix4. fs)
           (>= len-fs 9)  (Matrix3. fs)
           :else (throw (IllegalArgumentException. (str "Array must have at least 9 elements (found" len-fs ")")))))))

By my understanding, the type-hint should eliminate the need for reflection to resolve the call to .length. What am I missing?

2 Answers
Related