@@ -290,7 +290,7 @@ let make_constructor env type_path type_params sargs sret_type =
290290*)
291291
292292
293- let transl_declaration ~foundObject env sdecl id =
293+ let transl_declaration ~typeRecordAsObject env sdecl id =
294294 (* Bind type parameters *)
295295 reset_type_variables() ;
296296 Ctype. begin_def () ;
@@ -481,8 +481,8 @@ let transl_declaration ~foundObject env sdecl id =
481481 check_duplicates lbls StringSet. empty;
482482 Ttype_record lbls, Type_record (lbls', rep), sdecl
483483 | None ->
484- (* Could not fine type decl for ...t: assume t is an object type and this is syntax ambiguity *)
485- foundObject := true ;
484+ (* Could not find record type decl for ...t: assume t is an object type and this is syntax ambiguity *)
485+ typeRecordAsObject := true ;
486486 let fields = Ext_list. map lbls_ (fun ld ->
487487 match ld.pld_name.txt with
488488 | "..." -> Parsetree. Oinherit ld.pld_type
@@ -602,7 +602,7 @@ let check_constraints_labels env visited l pl =
602602 check_constraints_rec env (get_loc (Ident. name name) pl) visited ty)
603603 l
604604
605- let check_constraints ~foundObject env sdecl (_ , decl ) =
605+ let check_constraints ~typeRecordAsObject env sdecl (_ , decl ) =
606606 let visited = ref TypeSet. empty in
607607 begin match decl.type_kind with
608608 | Type_abstract -> ()
@@ -651,7 +651,7 @@ let check_constraints ~foundObject env sdecl (_, decl) =
651651 begin match decl.type_manifest with
652652 | None -> ()
653653 | Some ty ->
654- if not ! foundObject then
654+ if not ! typeRecordAsObject then
655655 let sty =
656656 match sdecl.ptype_manifest with Some sty -> sty | _ -> assert false
657657 in
@@ -1311,15 +1311,15 @@ let transl_type_decl env rec_flag sdecl_list =
13111311 | Asttypes. Recursive | Asttypes. Nonrecursive ->
13121312 id, None
13131313 in
1314- let foundObject = ref false in
1314+ let typeRecordAsObject = ref false in
13151315 let transl_declaration name_sdecl (id , slot ) =
13161316 current_slot := slot;
13171317 Builtin_attributes. warning_scope
13181318 name_sdecl.ptype_attributes
1319- (fun () -> transl_declaration temp_env name_sdecl id)
1319+ (fun () -> transl_declaration ~type RecordAsObject temp_env name_sdecl id)
13201320 in
13211321 let tdecls =
1322- List. map2 ( transl_declaration ~found Object) sdecl_list (List. map id_slots id_list) in
1322+ List. map2 transl_declaration sdecl_list (List. map id_slots id_list) in
13231323 let decls =
13241324 List. map (fun tdecl -> (tdecl.typ_id, tdecl.typ_type)) tdecls in
13251325 current_slot := None ;
@@ -1367,7 +1367,7 @@ let transl_type_decl env rec_flag sdecl_list =
13671367 | None -> () )
13681368 sdecl_list tdecls;
13691369 (* Check that constraints are enforced *)
1370- List. iter2 (check_constraints ~found Object newenv) sdecl_list decls;
1370+ List. iter2 (check_constraints ~type RecordAsObject newenv) sdecl_list decls;
13711371 (* Name recursion *)
13721372 let decls =
13731373 List. map2 (fun sdecl (id , decl ) -> id, name_recursion sdecl id decl)
0 commit comments