File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: a7840f02b0eb3d4247c66e5169f7f50e19e70d6d
2
+ refs/heads/master: 194f38fdff2b2067413b6eabf3d6da57fbba2dc1
Original file line number Diff line number Diff line change @@ -516,6 +516,17 @@ let sane_name (n:name) : bool =
516
516
| NAME_ext (prefix , _ ) -> sane_prefix prefix
517
517
;;
518
518
519
+ (* Error messages always refer to simple types structurally, not by their
520
+ * user-defined names. *)
521
+ let rec ty_is_simple (ty :ty ) : bool =
522
+ match ty with
523
+ TY_any | TY_nil | TY_bool | TY_mach _ | TY_int | TY_uint | TY_char
524
+ | TY_str | TY_task | TY_type -> true
525
+ | TY_vec ty | TY_chan ty | TY_port ty -> ty_is_simple ty
526
+ | TY_tup tys -> List. for_all ty_is_simple (Array. to_list tys)
527
+ | _ -> false
528
+ ;;
529
+
519
530
(*
520
531
* We have multiple subset-categories of expression:
521
532
*
Original file line number Diff line number Diff line change @@ -971,7 +971,7 @@ let ty_fold_rebuild (id:Ast.ty -> Ast.ty)
971
971
972
972
let rec pretty_ty_str (cx :ctxt ) (fallback :(Ast.ty -> string) ) (ty :Ast.ty ) =
973
973
let cache = cx.ctxt_user_type_names in
974
- if Hashtbl. mem cache ty then
974
+ if not ( Ast. ty_is_simple ty) && Hashtbl. mem cache ty then
975
975
let names = List. map (Ast. sprintf_name () ) (Hashtbl. find_all cache ty) in
976
976
String. concat " = " names
977
977
else
You can’t perform that action at this time.
0 commit comments