Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -Naur ocaml-4.00.1/typing/typedecl.ml ocaml-4.00.1-fast-typedecl/typing/typedecl.ml
- --- ocaml-4.00.1/typing/typedecl.ml 2013-03-12 14:24:13.886509684 +0100
- +++ ocaml-4.00.1-fast-typedecl/typing/typedecl.ml 2013-03-12 14:24:04.469509844 +0100
- @@ -315,6 +315,8 @@
- Btype.iter_type_expr (check_constraints_rec env loc visited) ty
- end
- +module SMap = Map.Make(String)
- +
- let check_constraints env (_, sdecl) (_, decl) =
- let visited = ref TypeSet.empty in
- begin match decl.type_kind with
- @@ -325,13 +327,16 @@
- | Ptype_record _ | Ptype_abstract -> assert false
- in
- let pl = find_pl sdecl.ptype_kind in
- + let pl_index =
- + let foldf acc (name, styl, sret_type, _) =
- + SMap.add name.txt (styl, sret_type) acc
- + in
- + List.fold_left foldf SMap.empty pl
- + in
- List.iter
- (fun (name, tyl, ret_type) ->
- let (styl, sret_type) =
- - try
- - let (_, sty, sret_type, _) =
- - List.find (fun (n,_,_,_) -> n.txt = Ident.name name) pl
- - in (sty, sret_type)
- + try SMap.find (Ident.name name) pl_index
- with Not_found -> assert false in
- List.iter2
- (fun sty ty ->
Add Comment
Please, Sign In to add comment