From 0b3423ef2cd3a7a181ae0d96ec803c347ed6a3bf Mon Sep 17 00:00:00 2001 From: Alain Frisch Date: Mon, 5 May 2014 11:21:45 +0000 Subject: #6387: also allow attributes on methods in object types (< m [@foo] : int; ..>). git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14741 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 --- tools/depend.ml | 2 +- tools/tast_iter.ml | 2 +- tools/untypeast.ml | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/depend.ml b/tools/depend.ml index e267e4f1da..f009b4a11b 100644 --- a/tools/depend.ml +++ b/tools/depend.ml @@ -43,7 +43,7 @@ let rec add_type bv ty = | Ptyp_arrow(_, t1, t2) -> add_type bv t1; add_type bv t2 | Ptyp_tuple tl -> List.iter (add_type bv) tl | Ptyp_constr(c, tl) -> add bv c; List.iter (add_type bv) tl - | Ptyp_object (fl, _) -> List.iter (fun (_, t) -> add_type bv t) fl + | Ptyp_object (fl, _) -> List.iter (fun (_, _, t) -> add_type bv t) fl | Ptyp_class(c, tl) -> add bv c; List.iter (add_type bv) tl | Ptyp_alias(t, s) -> add_type bv t | Ptyp_variant(fl, _, _) -> diff --git a/tools/tast_iter.ml b/tools/tast_iter.ml index a7723c88dc..b28731613a 100644 --- a/tools/tast_iter.ml +++ b/tools/tast_iter.ml @@ -303,7 +303,7 @@ let core_type sub ct = | Ttyp_constr (_path, _, list) -> List.iter (sub # core_type) list | Ttyp_object (list, _o) -> - List.iter (fun (_, t) -> sub # core_type t) list + List.iter (fun (_, _, t) -> sub # core_type t) list | Ttyp_class (_path, _, list) -> List.iter (sub # core_type) list | Ttyp_alias (ct, _s) -> diff --git a/tools/untypeast.ml b/tools/untypeast.ml index e8e392f681..c887c089e9 100644 --- a/tools/untypeast.ml +++ b/tools/untypeast.ml @@ -558,7 +558,8 @@ and untype_core_type ct = Ptyp_constr (lid, List.map untype_core_type list) | Ttyp_object (list, o) -> - Ptyp_object (List.map (fun (s, t) -> (s, untype_core_type t)) list, o) + Ptyp_object + (List.map (fun (s, a, t) -> (s, a, untype_core_type t)) list, o) | Ttyp_class (_path, lid, list) -> Ptyp_class (lid, List.map untype_core_type list) | Ttyp_alias (ct, s) -> -- cgit v1.2.1