diff --git a/typed/clj.analyzer/src/typed/clj/analyzer/utils.cljc b/typed/clj.analyzer/src/typed/clj/analyzer/utils.cljc index 37bfc3d40..d62090ae8 100644 --- a/typed/clj.analyzer/src/typed/clj/analyzer/utils.cljc +++ b/typed/clj.analyzer/src/typed/clj/analyzer/utils.cljc @@ -268,21 +268,22 @@ :default -(defn ^Class unbox - "If the argument is a Class with a primitive equivalent, returns that, +(do (def ^:private classes-with-primitives + {Integer Integer/TYPE, + Long Long/TYPE, + Float Float/TYPE, + Short Short/TYPE, + Boolean Boolean/TYPE, + Byte Byte/TYPE, + Character Character/TYPE, + Double Double/TYPE, + Void Void/TYPE}) + + (defn ^Class unbox + "If the argument is a Class with a primitive equivalent, returns that, otherwise returns the argument" - [c] - ({Integer Integer/TYPE, - Long Long/TYPE, - Float Float/TYPE, - Short Short/TYPE, - Boolean Boolean/TYPE, - Byte Byte/TYPE, - Character Character/TYPE, - Double Double/TYPE, - Void Void/TYPE} - c c)) -) + [c] + (classes-with-primitives c c)))) (defn numeric? "Returns true if the given class is numeric" diff --git a/typed/cljc.analyzer/src/typed/cljc/analyzer/utils.cljc b/typed/cljc.analyzer/src/typed/cljc/analyzer/utils.cljc index 49a992133..f0e180ed2 100644 --- a/typed/cljc.analyzer/src/typed/cljc/analyzer/utils.cljc +++ b/typed/cljc.analyzer/src/typed/cljc/analyzer/utils.cljc @@ -203,10 +203,8 @@ (defn- -source-info-into-transient! "Like `-source-info`, but returns a raw transient." - [x env dest] - (let [t (->> dest - (source-info-into-transient! env) - (source-info-into-transient! (meta x)))] + [x dest] + (let [t (source-info-into-transient! (meta x) dest)] (if-let [file (let [file #?(:cljs cljs-ana/*cljs-file* :default *file*)] (and (not= file "NO_SOURCE_FILE") @@ -217,7 +215,12 @@ (defn -source-info "Returns the source-info of x" ([x env] (-source-info x env {})) - ([x env base] (persistent! (-source-info-into-transient! x env (transient base))))) + ([x env base] + (persistent! (if (identical? env base) + (-source-info-into-transient! x (transient base)) + (->> (transient base) + (source-info-into-transient! env) + (-source-info-into-transient! x)))))) (defn const-val "Returns the value of a constant node (either :quote or :const)"
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: