From d75e2c8b01ffd0e7430be98203de3f571efee1aa Mon Sep 17 00:00:00 2001 From: Alain Frisch Date: Tue, 1 Apr 2014 11:46:00 +0000 Subject: Support for record arguments on exceptions. git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record2@14515 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 --- toplevel/genprintval.ml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'toplevel') diff --git a/toplevel/genprintval.ml b/toplevel/genprintval.ml index 3b184cec0..5dc829b52 100644 --- a/toplevel/genprintval.ml +++ b/toplevel/genprintval.ml @@ -293,7 +293,12 @@ module Make(O : OBJ)(EVP : EVALPATH with type valu = O.t) = struct in (lid, v) :: tree_of_fields (pos + 1) remainder in - Oval_record (tree_of_fields 0 lbl_list) + let pos = + match rep with + | Record_exception _ -> 1 + | _ -> 0 + in + Oval_record (tree_of_fields pos lbl_list) end with Not_found -> (* raised by Env.find_type *) @@ -379,7 +384,8 @@ module Make(O : OBJ)(EVP : EVALPATH with type valu = O.t) = struct if not (EVP.same_value slot (EVP.eval_path env path)) then raise Not_found; tree_of_constr_with_args - (fun x -> Oide_ident x) name false 1 depth bucket cstr.cstr_args + (fun x -> Oide_ident x) name cstr.cstr_inlined 1 depth bucket + cstr.cstr_args with Not_found | EVP.Error -> match check_depth depth bucket ty with Some x -> x -- cgit v1.2.3-70-g09d2