aboutsummaryrefslogtreecommitdiff
path: root/luxc/src/lux/type/host.clj
diff options
context:
space:
mode:
authorEduardo Julian2017-04-05 17:55:51 -0400
committerEduardo Julian2017-04-05 17:55:51 -0400
commitd6ce01f22aa14386758adf2b7b9e7b2e47bd4e2b (patch)
treede14e24ebb85c906626acd0660069ad2c1d85d55 /luxc/src/lux/type/host.clj
parentc9db1d195fc45ab296e11ab63e428d53708ab689 (diff)
- Made some improvements to error messages in the compiler.
Diffstat (limited to '')
-rw-r--r--luxc/src/lux/type/host.clj16
1 files changed, 9 insertions, 7 deletions
diff --git a/luxc/src/lux/type/host.clj b/luxc/src/lux/type/host.clj
index 40a3373f0..e2f7c1c1f 100644
--- a/luxc/src/lux/type/host.clj
+++ b/luxc/src/lux/type/host.clj
@@ -114,9 +114,10 @@
(let [gvar (.getName ^TypeVariable refl-type)]
(if-let [m-type (&/|get gvar matchings)]
(return m-type)
- (&/fail-with-loc (str "[Type Error] Unknown generic type variable: " gvar " -- " (->> matchings
- (&/|map &/|first)
- &/->seq)))))
+ (&/fail-with-loc (str "[Host Error] Unknown generic type-variable: " gvar "\n"
+ "Available type-variables: " (->> matchings
+ (&/|map &/|first)
+ &/->seq)))))
(instance? WildcardType refl-type)
(if-let [bound (->> ^WildcardType refl-type .getUpperBounds seq first)]
@@ -175,9 +176,10 @@
(&/$GenericTypeVar var-name)
(if-let [m-type (&/|get var-name matchings)]
(return m-type)
- (&/fail-with-loc (str "[Type Error] Unknown generic type variable: " var-name " -- " (->> matchings
- (&/|map &/|first)
- &/->seq))))
+ (&/fail-with-loc (str "[Host Error] Unknown generic type-variable: " var-name "\n"
+ "Available type-variables: " (->> matchings
+ (&/|map &/|first)
+ &/->seq))))
(&/$GenericWildcard)
existential))
@@ -231,7 +233,7 @@
(let [lineage (trace-lineage sub-class+ super-class+)]
(|do [[^Class sub-class* sub-params*] (raise existential lineage sub-class+ sub-params)]
(return (&/$HostT (.getName sub-class*) sub-params*))))
- (&/fail-with-loc (str "[Type Error] Classes don't have a subtyping relationship: " sub-class " </= " super-class)))))
+ (&/fail-with-loc (str "[Host Error] Classes do not have a subtyping relationship: " sub-class " </= " super-class)))))
(defn as-obj [class]
(case class