diff options
author | Alain Frisch <alain@frisch.fr> | 2013-03-06 13:51:18 +0000 |
---|---|---|
committer | Alain Frisch <alain@frisch.fr> | 2013-03-06 13:51:18 +0000 |
commit | 97c5f1a2530d0de9b1ee9f0088a550ceefbcde59 (patch) | |
tree | ed7615eb84147dc8bb730ee264cabd222ee62eb0 /typing/typedecl.ml | |
parent | cb3b398308cb1225e22e7eaac58a8394ac4ae085 (diff) |
Attributes on label in record type declarations.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13361 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'typing/typedecl.ml')
-rw-r--r-- | typing/typedecl.ml | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/typing/typedecl.ml b/typing/typedecl.ml index 6a865c586..da1ef0628 100644 --- a/typing/typedecl.ml +++ b/typing/typedecl.ml @@ -193,12 +193,12 @@ let transl_declaration env sdecl id = | Ptype_record lbls -> let all_labels = ref StringSet.empty in List.iter - (fun ({ txt = name }, mut, arg, loc) -> + (fun {pld_name = {txt=name}} -> if StringSet.mem name !all_labels then raise(Error(sdecl.ptype_loc, Duplicate_label name)); all_labels := StringSet.add name !all_labels) lbls; - let lbls = List.map (fun (name, mut, arg, loc) -> + let lbls = List.map (fun {pld_name=name;pld_mutable=mut;pld_type=arg;pld_loc=loc} -> let cty = transl_simple_type env true arg in (Ident.create name.txt, name, mut, cty, loc) ) lbls in @@ -348,8 +348,8 @@ let check_constraints env sdecl (_, decl) = let pl = find_pl sdecl.ptype_kind in let rec get_loc name = function [] -> assert false - | (name', _, sty, _) :: tl -> - if name = name'.txt then sty.ptyp_loc else get_loc name tl + | pld :: tl -> + if name = pld.pld_name.txt then pld.pld_type.ptyp_loc else get_loc name tl in List.iter (fun (name, _, ty) -> @@ -727,7 +727,7 @@ let check_duplicates sdecl_list = cl | Ptype_record fl -> List.iter - (fun (cname, _, _, loc) -> + (fun {pld_name=cname;pld_loc=loc} -> try let name' = Hashtbl.find labels cname.txt in Location.prerr_warning loc |