We're updating the issue view to help you get more done. 

Definline functions do not work as higher-order functions when AOT compiled

Description

See discussion on Clojure group: https://groups.google.com/d/topic/clojure/v0ipoiP8X1o/discussion

Functions defined with definline appear to misbehave when AOT compiled and used with higher-order functions - it seems like the macro function is stored instead of the expansion. I've attached a small test project here reproducing the issue. It can be run with:

1 2 3 lein compile lein uberjar java -jar target/aot-test-0.1.0-SNAPSHOT-standalone.jar

The relevant part of the test namespace is:

1 2 3 4 5 6 7 8 (definline java-list? [element] `(instance? List ~element)) (defn -main [& args] (println (java-list? 2)) (println ((var-get #'java-list?) 2)) (println (filter java-list? [1 2 3])) (println (map java-list? [1 2 3])))

The output produced is:

1 2 3 4 false (clojure.core/instance? java.util.List 2) (1 2 3) ((clojure.core/instance? java.util.List 1) (clojure.core/instance? java.util.List 2) (clojure.core/instance? java.util.List 3))

Environment

OSX 10.8, Linux

Status

Assignee

Unassigned

Reporter

Colin Fleming

Labels

Approval

None

Patch

Code and Test

Affects versions

Release 1.5

Priority

Blocker