diff options
| author | Patrick Walton <[email protected]> | 2010-10-21 11:13:57 -0700 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2010-10-21 11:14:38 -0700 |
| commit | a7840f02b0eb3d4247c66e5169f7f50e19e70d6d (patch) | |
| tree | 700e1bb1db0c4db7d7f1508ee8259ac04641f030 /src/boot/me/resolve.ml | |
| parent | oops, removed bits.test() from main (diff) | |
| download | rust-a7840f02b0eb3d4247c66e5169f7f50e19e70d6d.tar.xz rust-a7840f02b0eb3d4247c66e5169f7f50e19e70d6d.zip | |
Use "friendly" type names when reporting a "mismatched type-params" error
Diffstat (limited to 'src/boot/me/resolve.ml')
| -rw-r--r-- | src/boot/me/resolve.ml | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/boot/me/resolve.ml b/src/boot/me/resolve.ml index d0b54a74..4fafa05f 100644 --- a/src/boot/me/resolve.ml +++ b/src/boot/me/resolve.ml @@ -423,7 +423,10 @@ let type_resolving_visitor log cx "resolved item %s, defining type %a" id Ast.sprintf_ty ty; htab_put cx.ctxt_all_type_items item.id ty; - htab_put cx.ctxt_all_item_types item.id Ast.TY_type + htab_put cx.ctxt_all_item_types item.id Ast.TY_type; + if Hashtbl.mem cx.ctxt_all_item_names item.id then + Hashtbl.add cx.ctxt_user_type_names ty + (Hashtbl.find cx.ctxt_all_item_names item.id) (* * Don't resolve the "type" of a mod item; just resolve its @@ -880,19 +883,7 @@ let process_crate end; (* Post-resolve, we can establish a tag cache. *) cx.ctxt_tag_cache <- Some (Hashtbl.create 0); - cx.ctxt_rebuild_cache <- Some (Hashtbl.create 0); - - (* Also index all the type names for future error messages. *) - Hashtbl.iter - begin - fun item_id ty -> - let item_names = cx.Semant.ctxt_all_item_names in - if Hashtbl.mem item_names item_id then - Hashtbl.add cx.Semant.ctxt_user_type_names ty - (Hashtbl.find item_names item_id) - end - cx.Semant.ctxt_all_type_items; - + cx.ctxt_rebuild_cache <- Some (Hashtbl.create 0) ;; (* |