diff options
| author | Patrick Walton <[email protected]> | 2010-11-05 18:27:15 -0700 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2010-11-05 18:27:34 -0700 |
| commit | de166745b8035395485bc5bc598f9c507ae80376 (patch) | |
| tree | 3c602c234e9eac5f09b58dd5ac31fac35c9cca63 /src/boot | |
| parent | rustboot: If something that wasn't a type was found where a type was expected... (diff) | |
| download | rust-de166745b8035395485bc5bc598f9c507ae80376.tar.xz rust-de166745b8035395485bc5bc598f9c507ae80376.zip | |
rustboot: Report the alias-ness of function parameters in type errors
Diffstat (limited to 'src/boot')
| -rw-r--r-- | src/boot/me/semant.ml | 7 |
1 files changed, 6 insertions, 1 deletions
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 |