aboutsummaryrefslogtreecommitdiff
path: root/luxc/src
diff options
context:
space:
mode:
authorEduardo Julian2017-01-06 19:27:18 -0400
committerEduardo Julian2017-01-06 19:27:18 -0400
commit4dc64964009674d947f97639bdfae4faa544bc6c (patch)
tree4682e821a71df2010370f29e361cd0023b1c8529 /luxc/src
parentbc29c83e75e103c7594ba9483f19170e94abcc85 (diff)
- Fixed a bug when deserializing annotations through the compiler cache.
Diffstat (limited to 'luxc/src')
-rw-r--r--luxc/src/lux/analyser/meta.clj4
-rw-r--r--luxc/src/lux/compiler/cache.clj4
-rw-r--r--luxc/src/lux/compiler/cache/ann.clj7
-rw-r--r--luxc/src/lux/compiler/io.clj4
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 [<name> <tag-name>]
(def <name> (&/T [tag-prefix <tag-name>]))
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)))))