=> (def arr1 (make-array Long/TYPE 10)) => (def arr2 (make-array Long/TYPE 10 10)) => (def arr3 (make-array Long/TYPE 10 10 10)) => (use 'clj-java-decompiler.core) => (set! *warn-on-reflection true) ;;;; Reflection cases - all expected => (aget arr1 1) Reflection warning, null:1:1 - call to static method aget on clojure.lang.RT can't be resolved (argument types: unknown, int). 0 => (aget arr3 1 2 3) Reflection warning, null:1:1 - call to static method aget on clojure.lang.RT can't be resolved (argument types: unknown, int). 0 => (aget arr2 1 2) Reflection warning, null:1:1 - call to static method aget on clojure.lang.RT can't be resolved (argument types: unknown, int). 0 ;;;; Non-inlined cases continue to work => (#'aget arr1 1) 0 => (#'aget arr2 1 2) 0 => (#'aget arr3 1 2 3) 0 ;;;; Inlined cases withouh reflection => (aget ^"[J" arr1 1) 0 => (aget ^"[[J" arr2 1 2) 0 => (aget ^"[[[J" arr3 1 2 3) 0 ;;;; Compiles into what we expect => (decompile (fn [] (aget ^"[[[J" arr3 1 2 3))) ;; Trimmed and simplified public static Object invokeStatic() { return Numbers.num(RT.aget((long[])RT.aget((Object[])RT.aget((Object[])arr3, RT.intCast(1L)), RT.intCast(2L)), RT.intCast(3L))); } ;;;; Does sensible thing if we underspecify the type of the array => (decompile (fn [] (aget ^objects arr3 1 2 3))) ;; Trimmed and simplified public static Object invokeStatic() { return apply.invoke(aget, RT.aget((Object[])arr3, RT.intCast(1L)), list.invoke(2L, 3L)); } ;;;; aset reflection cases - all expected too => (aset arr1 1 42) Reflection warning, null:1:1 - call to static method aset on clojure.lang.RT can't be resolved (argument types: unknown, int, long). 42 => (aset arr2 1 2 42) Reflection warning, null:1:1 - call to static method aget on clojure.lang.RT can't be resolved (argument types: unknown, int). Reflection warning, null:1:1 - call to static method aset on clojure.lang.RT can't be resolved (argument types: unknown, int, long). 42 => (aset arr3 1 2 3 42) Reflection warning, null:1:1 - call to static method aget on clojure.lang.RT can't be resolved (argument types: unknown, int). Reflection warning, null:1:1 - call to static method aset on clojure.lang.RT can't be resolved (argument types: unknown, int, long). 42 ;;;; non-inlined aset - works => (#'aset arr1 1 42) 42 => (#'aset arr2 1 2 42) 42 => (#'aset arr3 1 2 3 42) 42 ;;;; inlined asets - no reflection => (aset ^"[J" arr1 1 42) 42 => (aset ^"[[J" arr2 1 2 42) 42 => (aset ^"[[[J" arr3 1 2 3 42) 42 ;;;; compiler output ;; Trimmed and simplified public static Object invokeStatic() { return Numbers.num(RT.aset((long[])RT.aget((Object[])RT.aget((Object[])arr3, RT.intCast(1L)), RT.intCast(2L)), RT.intCast(3L), 42L)); }