aboutsummaryrefslogtreecommitdiff
path: root/src/boot
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-10-18 14:36:17 -0700
committerGraydon Hoare <[email protected]>2010-10-18 14:36:17 -0700
commit7801ba9dfe0885be8cf1fe93ba1afba1b5862862 (patch)
tree15c5d8442a113e23173d952d8b89f59306e62ce4 /src/boot
parentFlesh out the std.list module a touch. (diff)
downloadrust-7801ba9dfe0885be8cf1fe93ba1afba1b5862862.tar.xz
rust-7801ba9dfe0885be8cf1fe93ba1afba1b5862862.zip
Make type errors in rustboot report the friendly type of both expected and actual.
Diffstat (limited to 'src/boot')
-rw-r--r--src/boot/me/type.ml6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/boot/me/type.ml b/src/boot/me/type.ml
index 434bab7e..e2295e4c 100644
--- a/src/boot/me/type.ml
+++ b/src/boot/me/type.ml
@@ -223,8 +223,8 @@ let type_error_full expected actual =
raise (Type_error (expected, actual))
;;
-let type_error expected actual =
- type_error_full expected (head_only actual)
+let type_error cx expected actual =
+ type_error_full expected (friendly_stringify cx head_only actual)
;;
(* We explicitly curry [cx] like this to avoid threading it through all the
@@ -278,6 +278,8 @@ let check_stmt (cx:Semant.ctxt) : (fn_ctx -> Ast.stmt -> unit) =
* Type assertions
*)
+ let type_error = type_error cx in
+
let is_integer (ty:Ast.ty) =
match ty with
Ast.TY_int | Ast.TY_uint