diff options
| author | Graydon Hoare <[email protected]> | 2010-10-18 14:36:17 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-10-18 14:36:17 -0700 |
| commit | 7801ba9dfe0885be8cf1fe93ba1afba1b5862862 (patch) | |
| tree | 15c5d8442a113e23173d952d8b89f59306e62ce4 /src/boot | |
| parent | Flesh out the std.list module a touch. (diff) | |
| download | rust-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.ml | 6 |
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 |