scgilardi / slingshot

Enhanced try and throw for Clojure leveraging Clojure's capabilities
654 stars 28 forks source link

strange try+ reflection warnings (0.10.3) #37

Closed martintrojer closed 10 years ago

martintrojer commented 11 years ago
user> *warn-on-reflection*
true
user> (slingshot.slingshot/try+ (inc 1) (catch Exception e (.getMessage e)))
Reflection warning, /tmp/form-init8815318833609231005.clj:1:54 - reference to field getMessage can't be resolved.
2

;; but

user> (try (inc 1) (catch Exception e (.getMessage e)))
2
pjstadig commented 10 years ago

I believe this is because slingshot is not adding a type hint for the class selector case. I've tried adding type hints in that case, but for some reason the type hint isn't propagating. https://github.com/pjstadig/slingshot/tree/fix-reflection