Skip to content

Commit 2283df9

Browse files
author
Damien Doligez
committed
PR#6889: ast_mapper fails to rewrite class attributes
git-svn-id: http://caml.inria.fr/svn/ocaml/version/4.02@16155 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1 parent 8935852 commit 2283df9

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Changes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ Bug fixes:
206206
(Adrien Nader)
207207
- PR#6886: -no-alias-deps allows to build self-referential compilation units
208208
(Jacques Garrigue, report by Valentin Gatien-Baron)
209+
- PR#6889: ast_mapper fails to rewrite class attributes
210+
(Sébastien Briais)
209211
- GPR#143: fix getsockopt behaviour for boolean socket options
210212
(Anil Madhavapeddy and Andrew Ray)
211213
- GPR#190: typo in pervasives

parsing/ast_mapper.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ module CT = struct
174174
let map sub {pcty_loc = loc; pcty_desc = desc; pcty_attributes = attrs} =
175175
let open Cty in
176176
let loc = sub.location sub loc in
177+
let attrs = sub.attributes sub attrs in
177178
match desc with
178179
| Pcty_constr (lid, tys) ->
179180
constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tys)
@@ -186,6 +187,7 @@ module CT = struct
186187
=
187188
let open Ctf in
188189
let loc = sub.location sub loc in
190+
let attrs = sub.attributes sub attrs in
189191
match desc with
190192
| Pctf_inherit ct -> inherit_ ~loc ~attrs (sub.class_type sub ct)
191193
| Pctf_val (s, m, v, t) -> val_ ~loc ~attrs s m v (sub.typ sub t)
@@ -410,6 +412,7 @@ module CE = struct
410412
let map sub {pcl_loc = loc; pcl_desc = desc; pcl_attributes = attrs} =
411413
let open Cl in
412414
let loc = sub.location sub loc in
415+
let attrs = sub.attributes sub attrs in
413416
match desc with
414417
| Pcl_constr (lid, tys) ->
415418
constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tys)
@@ -437,6 +440,7 @@ module CE = struct
437440
let map_field sub {pcf_desc = desc; pcf_loc = loc; pcf_attributes = attrs} =
438441
let open Cf in
439442
let loc = sub.location sub loc in
443+
let attrs = sub.attributes sub attrs in
440444
match desc with
441445
| Pcf_inherit (o, ce, s) -> inherit_ ~loc ~attrs o (sub.class_expr sub ce) s
442446
| Pcf_val (s, m, k) -> val_ ~loc ~attrs (map_loc sub s) m (map_kind sub k)

0 commit comments

Comments
 (0)