aboutsummaryrefslogtreecommitdiff
path: root/luxc/src/lux/compiler/lux.clj
diff options
context:
space:
mode:
authorEduardo Julian2016-12-04 23:43:07 -0400
committerEduardo Julian2016-12-04 23:43:07 -0400
commit639e2f66c4eafa045e9ec0e2e06eb87473b7b51b (patch)
tree544d99475970d0f361f36331dd3ae066b7002e79 /luxc/src/lux/compiler/lux.clj
parentf44c594e29c33639a0fcd6e2c46c15f0012d2e91 (diff)
- Fixed a bug wherein aliased definitions where getting assigned non-type values, instead of types in the compiler state.
Diffstat (limited to '')
-rw-r--r--luxc/src/lux/compiler/lux.clj10
1 files changed, 6 insertions, 4 deletions
diff --git a/luxc/src/lux/compiler/lux.clj b/luxc/src/lux/compiler/lux.clj
index 5dc8becc0..3d7c4aa7b 100644
--- a/luxc/src/lux/compiler/lux.clj
+++ b/luxc/src/lux/compiler/lux.clj
@@ -264,9 +264,9 @@
(if (= 1 (&/|length ?meta))
(|do [:let [current-class (&host-generics/->class-name (str (&host/->module-class r-module) "/" (&host/def-name r-name)))
def-class (&&/load-class! class-loader current-class)
- def-type (&a-module/def-type r-module r-name)
def-meta ?meta
def-value (-> def-class (.getField &/value-field) (.get nil))]
+ def-type (&a-module/def-type r-module r-name)
_ (&/without-repl-closure
(&a-module/define module-name ?name def-type def-meta def-value))]
(return nil))
@@ -316,8 +316,10 @@
_
false)
- def-meta ?meta
- def-value (-> def-class (.getField &/value-field) (.get nil))]
+ def-meta ?meta]
+ def-value (try (return (-> def-class (.getField &/value-field) (.get nil)))
+ (catch Throwable t
+ (&/assert! "Error during value initialization." (throwable->text t))))
_ (&/without-repl-closure
(&a-module/define module-name ?name def-type def-meta def-value))
_ (|case (&/T [is-type? (&a-meta/meta-get &a-meta/tags-tag def-meta)])
@@ -388,7 +390,7 @@
def-meta ?meta]
def-value (try (return (-> def-class (.getField &/value-field) (.get nil)))
(catch Throwable t
- (&/assert! false (throwable->text t))))
+ (&/assert! "Error during value initialization." (throwable->text t))))
_ (&/without-repl-closure
(&a-module/define module-name ?name def-type def-meta def-value))
_ (|case (&/T [is-type? (&a-meta/meta-get &a-meta/tags-tag def-meta)])