@@ -550,7 +550,9 @@ let rec unsafe_mapper : Ast_mapper.mapper =
550
550
begin match Ast_attributes. iter_process_derive_type
551
551
(Ext_list. last tdcls).ptype_attributes with
552
552
| {bs_deriving = Some actions; explict_nonrec}
553
- -> Ast_signature. fuse sigi
553
+ ->
554
+ let loc = sigi.psig_loc in
555
+ Ast_signature. fuse ~loc sigi
554
556
(self.signature
555
557
self
556
558
(Ast_derive. gen_signature tdcls actions explict_nonrec))
@@ -610,21 +612,17 @@ let rec unsafe_mapper : Ast_mapper.mapper =
610
612
((Ext_list. last tdcls).ptype_attributes) with
611
613
| {bs_deriving = Some actions;
612
614
explict_nonrec
613
- } ->
614
- (* let new_tdcls = (* * FIXME: mark as used instead of dropping*)
615
- (Ext_list.map_last (fun last tdcl ->
616
- if last then
617
- self.type_declaration self {tdcl with ptype_attributes}
618
- else
619
- self.type_declaration self tdcl) tdcls) in *)
620
- Ast_structure. fuse_with_constraint
621
- ~loc: str.pstr_loc
622
- tdcls
615
+ } ->
616
+ let loc = str.pstr_loc in
617
+ Ast_structure. fuse ~loc
618
+ str
623
619
(self.structure self
624
- (Ast_derive. gen_structure
625
- tdcls actions explict_nonrec ))
626
- (self.signature self
627
- (Ast_derive. gen_signature tdcls actions explict_nonrec))
620
+ (List. map
621
+ (fun action ->
622
+ Ast_derive. gen_structure_signature
623
+ loc
624
+ tdcls action explict_nonrec
625
+ ) actions))
628
626
| {bs_deriving = None } ->
629
627
Ast_mapper. default_mapper.structure_item self str
630
628
end
0 commit comments