diff --git a/CHANGES.md b/CHANGES.md index 8e0acbb..e902735 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ * Bug fix: Fix race condition relating to retrieving path from cache and AOT compilation * Bug fix: LAST no longer converts lists to vectors +* Bug fix: Workaround issue with aot + uberjar ## 0.13.1 diff --git a/src/clj/com/rpl/specter.cljc b/src/clj/com/rpl/specter.cljc index 2b52959..8babf01 100644 --- a/src/clj/com/rpl/specter.cljc +++ b/src/clj/com/rpl/specter.cljc @@ -260,7 +260,7 @@ (i/intern* *ns* cache-sym (i/mutable-cell))) `(let [info# ~get-cache-code - ^com.rpl.specter.impl.CachedPathInfo info# + info# (if (nil? info#) (let [~info-sym (i/magic-precompilation ~prepared-path @@ -271,8 +271,8 @@ ~info-sym) info#) - ~precompiled-sym (.-precompiled info#) - dynamic?# (.-dynamic? info#)] + ~precompiled-sym (i/cached-path-info-precompiled info#) + dynamic?# (i/cached-path-info-dynamic? info#)] (if dynamic?# ~handle-params-code ~precompiled-sym)))) diff --git a/src/clj/com/rpl/specter/impl.cljc b/src/clj/com/rpl/specter/impl.cljc index 364913c..f4e5096 100644 --- a/src/clj/com/rpl/specter/impl.cljc +++ b/src/clj/com/rpl/specter/impl.cljc @@ -428,6 +428,16 @@ [dynamic? precompiled]) +;; these are defined to avoid having to type-hint the CachedPathInfo +;; in com.rpl.specter/path, which causes problems during aot/uberjar +;; (clojure seems to be defining CachedPathInfo multiple times) +(defn cached-path-info-precompiled [^CachedPathInfo c] + (.-precompiled c)) + +(defn cached-path-info-dynamic? [^CachedPathInfo c] + (.-dynamic? c)) + + (defn filter-select [afn structure next-fn] (if (afn structure) (next-fn structure)