@@ -11,7 +11,9 @@ let mk_loc start_loc end_loc =
1111 Location. {loc_start = start_loc; loc_end = end_loc; loc_ghost = false }
1212
1313type inline_types_context = {
14- mutable found_inline_types : (string * Warnings .loc * Parsetree .type_kind ) list ;
14+ mutable found_inline_types :
15+ (string * Warnings .loc * Parsetree .type_kind ) list ;
16+ params : (Parsetree .core_type * Asttypes .variance ) list ;
1517}
1618
1719module Recover = struct
@@ -4212,7 +4214,7 @@ and parse_record_or_object_type ?current_type_name_path ?inline_types_context
42124214 :: inline_types_context.found_inline_types;
42134215
42144216 let lid = Location. mkloc (Longident. Lident inline_type_name) loc in
4215- Ast_helper.Typ. constr ~loc lid []
4217+ Ast_helper.Typ. constr ~loc lid (inline_types_context.params |> List. map fst)
42164218 | _ ->
42174219 let () =
42184220 match p.token with
@@ -5599,7 +5601,7 @@ and parse_type_definition_or_extension ~attrs p =
55995601 |> Diagnostics. message)
56005602 in
56015603 let current_type_name_path = Longident. flatten name.txt in
5602- let inline_types_context = {found_inline_types = [] } in
5604+ let inline_types_context = {found_inline_types = [] ; params } in
56035605 let type_defs =
56045606 parse_type_definitions ~inline_types_context ~current_type_name_path
56055607 ~attrs ~name ~params ~start_pos p
@@ -5612,7 +5614,7 @@ and parse_type_definition_or_extension ~attrs p =
56125614 let inline_types =
56135615 inline_types_context.found_inline_types
56145616 |> List. map (fun (inline_type_name , loc , kind ) ->
5615- Ast_helper.Type. mk
5617+ Ast_helper.Type. mk ~params
56165618 ~attrs: [(Location. mknoloc " res.inlineRecordDefinition" , PStr [] )]
56175619 ~loc ~kind
56185620 {name with txt = inline_type_name})
0 commit comments