The following trivial code generates a reflection warning for the call to hashCode:

(set! *warn-on-reflection* true)

(defn foo [o]
  (.hashCode o))

It's easy to fix:

(defn foo [#^Object o]
  (.hashCode o))

but I don't understand why a type hint for java.lang.Object could ever be necessary. My understanding is (was?) that java.lang.Object is the default type for all function arguments in Clojure. Am I wrong?

Konrad.

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to