Apply metadata to primitive fns causes them to lose their primitive-ness

Description

user> (def f (fn

x))
#'user/f
user> (.invokePrim (with-meta f {}) 1)
IllegalArgumentException No matching method found: invokePrim for class clojure.lang.AFunction$1 clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:53)
user> (contains? (ancestors (class f)) clojure.lang.IFn$LO)
true
user> (contains? (ancestors (class (with-meta f {}))) clojure.lang.IFn$LO)
false

We're working on libraries that use metadata on functions to track information about their arguments (schemata, etc), and this currently blocks us from fully supporting primitive fns.

Environment

None

Activity

Show:

Details

Assignee

Reporter

Priority

Affects versions

Created April 13, 2013 at 6:27 AM
Updated April 13, 2013 at 6:27 AM