@@ -202,33 +202,46 @@ let handle_typ
202
202
203
203
let check_auto_uncurry core_type = self.typ self core_type in
204
204
let methods =
205
- List. map (fun (label , ptyp_attrs , core_type ) ->
206
- match Ast_attributes. process_attributes_rev ptyp_attrs with
207
- | `Nothing , _ ->
208
- label, ptyp_attrs , check_auto_uncurry core_type
209
- | `Uncurry , ptyp_attrs ->
210
- label , ptyp_attrs,
211
- check_auto_uncurry
212
- { core_type with
213
- ptyp_attributes =
214
- Ast_attributes. bs :: core_type .ptyp_attributes}
215
- | `Method , ptyp_attrs
216
- ->
217
- label , ptyp_attrs,
218
- check_auto_uncurry
219
- { core_type with
220
- ptyp_attributes =
221
- Ast_attributes. bs_method :: core_type .ptyp_attributes}
222
- | `Meth_callback , ptyp_attrs
223
- ->
224
- label , ptyp_attrs,
225
- check_auto_uncurry
226
- { core_type with
227
- ptyp_attributes =
228
- Ast_attributes. bs_this :: core_type .ptyp_attributes}
229
- ) methods
230
-
231
- in
205
+ methods
206
+ |> List. map (fun (label , ptyp_attrs , core_type ) ->
207
+ (match Ast_attributes. process_attributes_rev ptyp_attrs with
208
+ | `Nothing , _ ->
209
+ label, ptyp_attrs , check_auto_uncurry core_type
210
+ | `Uncurry , ptyp_attrs ->
211
+ label , ptyp_attrs,
212
+ check_auto_uncurry
213
+ { core_type with
214
+ ptyp_attributes =
215
+ Ast_attributes. bs :: core_type .ptyp_attributes}
216
+ | `Method , ptyp_attrs
217
+ ->
218
+ label , ptyp_attrs,
219
+ check_auto_uncurry
220
+ { core_type with
221
+ ptyp_attributes =
222
+ Ast_attributes. bs_method :: core_type .ptyp_attributes}
223
+ | `Meth_callback , ptyp_attrs
224
+ ->
225
+ label , ptyp_attrs,
226
+ check_auto_uncurry
227
+ { core_type with
228
+ ptyp_attributes =
229
+ Ast_attributes. bs_this :: core_type .ptyp_attributes})
230
+ )
231
+ in
232
+ let methods =
233
+ List. fold_right (fun (label , ptyp_attrs , core_type ) acc ->
234
+ let get ty name attrs =
235
+ name , attrs, ty in
236
+ let set ty name attrs =
237
+ name, attrs,
238
+ Ast_util. to_method_type loc self " " ty
239
+ (Ast_literal. type_unit ~loc () ) in
240
+ let no ty =
241
+ label, ptyp_attrs, ty in
242
+ process_getter_setter ~no ~get ~set
243
+ loc label ptyp_attrs core_type acc
244
+ ) methods [] in
232
245
let inner_type =
233
246
{ ty
234
247
with ptyp_desc = Ptyp_object (methods, closed_flag);
0 commit comments