From de166745b8035395485bc5bc598f9c507ae80376 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Fri, 5 Nov 2010 18:27:15 -0700 Subject: rustboot: Report the alias-ness of function parameters in type errors --- src/boot/me/semant.ml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/boot/me/semant.ml b/src/boot/me/semant.ml index 9a5cee15..c22e788b 100644 --- a/src/boot/me/semant.ml +++ b/src/boot/me/semant.ml @@ -999,9 +999,14 @@ let rec pretty_ty_str (cx:ctxt) (fallback:(Ast.ty -> string)) (ty:Ast.ty) = "rec(" ^ (String.concat ", " fields) ^ ")" | Ast.TY_fn (fnsig, aux) -> let format_slot slot = + let prefix = + match slot.Ast.slot_mode with + Ast.MODE_local -> "" + | Ast.MODE_alias -> "&" + in match slot.Ast.slot_ty with None -> Common.bug () "no ty in slot" - | Some ty' -> pretty_ty_str cx fallback ty' + | Some ty' -> prefix ^ (pretty_ty_str cx fallback ty') in let effect = aux.Ast.fn_effect in let qual = Fmt.sprintf_fmt Ast.fmt_effect_qual () effect in -- cgit v1.2.3