fix error when using specter with aot

This commit is contained in:
Nathan Marz 2016-06-27 17:32:02 -04:00
parent b7191b11c2
commit 9c9b19af26
2 changed files with 11 additions and 1 deletions

View file

@ -18,6 +18,7 @@ transformations with `transform` one after another when the transformations shar
* Bug fix: END, BEGINNING, FIRST, LAST, and MAP-VALS now work properly on nil * Bug fix: END, BEGINNING, FIRST, LAST, and MAP-VALS now work properly on nil
* Bug fix: ALL and MAP-VALS now maintain the comparator of sorted maps * Bug fix: ALL and MAP-VALS now maintain the comparator of sorted maps
* Bug fix: Using value collection along with `setval` no longer throws exception * Bug fix: Using value collection along with `setval` no longer throws exception
* Bug fix: Fix error when trying to use Specter along with AOT compilation
## 0.11.2 ## 0.11.2
* Renamed com.rpl.specter.transient namespace to com.rpl.specter.transients to eliminate ClojureScript compiler warning about reserved keyword * Renamed com.rpl.specter.transient namespace to com.rpl.specter.transients to eliminate ClojureScript compiler warning about reserved keyword

View file

@ -536,7 +536,16 @@
info-sym (gensym "info") info-sym (gensym "info")
get-cache-code (if (= platform :clj) get-cache-code (if (= platform :clj)
`(i/get-cell ~cache-sym) `(try (i/get-cell ~cache-sym)
(catch ClassCastException e#
(if (bound? (var ~cache-sym))
(throw e#)
(do
(alter-var-root
(var ~cache-sym)
(fn [_#] (i/mutable-cell)))
nil
))))
cache-sym cache-sym
) )
add-cache-code (if (= platform :clj) add-cache-code (if (= platform :clj)