diff options
author | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 2012-01-21 03:40:37 +0000 |
---|---|---|
committer | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 2012-01-21 03:40:37 +0000 |
commit | 5dd1a02514c6b2560d79c403f535e63c27c4e8d6 (patch) | |
tree | 56ea4358484253f7d6c8b145a6fbb68e8e77e4dd | |
parent | a3cc246dec49681e8c71c89acef9ef29321b4dd1 (diff) | |
download | ocaml-5dd1a02514c6b2560d79c403f535e63c27c4e8d6.tar.gz |
cleaner fix of PR#5490
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12063 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | typing/typecore.ml | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/typing/typecore.ml b/typing/typecore.ml index 9e4f5a0e21..88401efe44 100644 --- a/typing/typecore.ml +++ b/typing/typecore.ml @@ -112,7 +112,8 @@ let iter_expression f e = | Pexp_assertfalse | Pexp_new _ | Pexp_constant _ -> () - | Pexp_function (_, eo, pel) -> may expr eo; List.iter (fun (_, e) -> expr e) pel + | Pexp_function (_, eo, pel) -> + may expr eo; List.iter (fun (_, e) -> expr e) pel | Pexp_apply (e, lel) -> expr e; List.iter (fun (_, e) -> expr e) lel | Pexp_let (_, pel, e) | Pexp_match (e, pel) @@ -121,7 +122,8 @@ let iter_expression f e = | Pexp_tuple el -> List.iter expr el | Pexp_construct (_, eo, _) | Pexp_variant (_, eo) -> may expr eo - | Pexp_record (iel, eo) -> may expr eo; List.iter (fun (_, e) -> expr e) iel + | Pexp_record (iel, eo) -> + may expr eo; List.iter (fun (_, e) -> expr e) iel | Pexp_open (_, e) | Pexp_newtype (_, e) | Pexp_poly (e, _) @@ -172,8 +174,10 @@ let iter_expression f e = | Pcl_constr _ -> () | Pcl_structure (_, cfl) -> List.iter class_field cfl | Pcl_fun (_, eo, _, ce) -> may expr eo; class_expr ce - | Pcl_apply (ce, lel) -> class_expr ce; List.iter (fun (_, e) -> expr e) lel - | Pcl_let (_, pel, ce) -> List.iter (fun (_, e) -> expr e) pel; class_expr ce + | Pcl_apply (ce, lel) -> + class_expr ce; List.iter (fun (_, e) -> expr e) lel + | Pcl_let (_, pel, ce) -> + List.iter (fun (_, e) -> expr e) pel; class_expr ce | Pcl_constraint (ce, _) -> class_expr ce and class_field = function @@ -1376,14 +1380,15 @@ let duplicate_ident_types loc caselist env = List.fold_left (fun env s -> try - (* XXX This will mark the value as being used; I don't think this is what we want *) - let (path, desc) = Typetexp.find_value env loc (Longident.Lident s) in + (* XXX This will mark the value as being used; + I don't think this is what we want *) + let (path, desc) = Env.lookup_value (Longident.Lident s) env in match path with Path.Pident id -> let desc = {desc with val_type = correct_levels desc.val_type} in Env.add_value id desc env | _ -> env - with Not_found | Typetexp.Error (_, Typetexp.Unbound_value _) -> env) + with Not_found -> env) env idents (* Typing of expressions *) |