From 4dc64964009674d947f97639bdfae4faa544bc6c Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 6 Jan 2017 19:27:18 -0400 Subject: - Fixed a bug when deserializing annotations through the compiler cache. --- luxc/src/lux/analyser/meta.clj | 4 ++-- luxc/src/lux/compiler/cache.clj | 4 ++-- luxc/src/lux/compiler/cache/ann.clj | 7 +++++-- luxc/src/lux/compiler/io.clj | 4 ++-- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/luxc/src/lux/analyser/meta.clj b/luxc/src/lux/analyser/meta.clj index 831386f47..20bbaef68 100644 --- a/luxc/src/lux/analyser/meta.clj +++ b/luxc/src/lux/analyser/meta.clj @@ -31,8 +31,8 @@ &/$None _ - (assert false (prn-str (&/adt->text ident) - (&/adt->text dict))))) + (assert false (println-str (&/adt->text ident) + (&/adt->text dict))))) (do-template [ ] (def (&/T [tag-prefix ])) diff --git a/luxc/src/lux/compiler/cache.clj b/luxc/src/lux/compiler/cache.clj index 5dbaf7ca2..dbb7945b8 100644 --- a/luxc/src/lux/compiler/cache.clj +++ b/luxc/src/lux/compiler/cache.clj @@ -142,7 +142,7 @@ (&a-module/define module _name def-type def-anns def-value))) 3 (let [[_name _type _anns] parts def-class (&&/load-class! loader (str (&host-generics/->class-name module) "." (&host/def-name _name))) - [def-anns _] (&&&ann/deserialize-anns _anns) + def-anns (&&&ann/deserialize-anns _anns) [def-type _] (&&&type/deserialize-type _type) def-value (get-field &/value-field def-class)] (&a-module/define module _name def-type def-anns def-value))))) @@ -203,7 +203,7 @@ (list))) (defn ^:private enumerate-cached-modules! [] - (let [output-dir (new File @&&/!output-dir) + (let [output-dir (new File ^String @&&/!output-dir) prefix-to-subtract (inc (.length (.getAbsolutePath output-dir)))] (->> output-dir enumerate-cached-modules!* diff --git a/luxc/src/lux/compiler/cache/ann.clj b/luxc/src/lux/compiler/cache/ann.clj index d372876f6..7f343d229 100644 --- a/luxc/src/lux/compiler/cache/ann.clj +++ b/luxc/src/lux/compiler/cache/ann.clj @@ -155,5 +155,8 @@ (deserialize-dict input) (assert false "[Cache error] Can't deserialize annocation."))) -(defn deserialize-anns [^String input] - (deserialize-seq deserialize-ann-entry input)) +(defn deserialize-anns + "(-> Text Text)" + [^String input] + (let [[output _] (deserialize-seq deserialize-ann-entry input)] + output)) diff --git a/luxc/src/lux/compiler/io.clj b/luxc/src/lux/compiler/io.clj index 12073a0a5..aea1c352d 100644 --- a/luxc/src/lux/compiler/io.clj +++ b/luxc/src/lux/compiler/io.clj @@ -16,7 +16,7 @@ (reset! !libs (&lib/load))) (defn read-file [source-dirs ^String file-name] - (|case (&/|some (fn [source-dir] + (|case (&/|some (fn [^String source-dir] (let [file (new java.io.File source-dir file-name)] (if (.exists file) (&/$Some file) @@ -28,4 +28,4 @@ (&/$None) (if-let [code (get @!libs file-name)] (return code) - (fail (str "[I/O Error] File doesn't exist: " file-name))))) + (&/fail-with-loc (str "[I/O Error] File doesn't exist: " file-name))))) -- cgit v1.2.3