@@ -11,7 +11,9 @@ let mk_loc start_loc end_loc =
11
11
Location. {loc_start = start_loc; loc_end = end_loc; loc_ghost = false }
12
12
13
13
type 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 ;
15
17
}
16
18
17
19
module Recover = struct
@@ -4212,7 +4214,7 @@ and parse_record_or_object_type ?current_type_name_path ?inline_types_context
4212
4214
:: inline_types_context.found_inline_types;
4213
4215
4214
4216
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)
4216
4218
| _ ->
4217
4219
let () =
4218
4220
match p.token with
@@ -5599,7 +5601,7 @@ and parse_type_definition_or_extension ~attrs p =
5599
5601
|> Diagnostics. message)
5600
5602
in
5601
5603
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
5603
5605
let type_defs =
5604
5606
parse_type_definitions ~inline_types_context ~current_type_name_path
5605
5607
~attrs ~name ~params ~start_pos p
@@ -5612,7 +5614,7 @@ and parse_type_definition_or_extension ~attrs p =
5612
5614
let inline_types =
5613
5615
inline_types_context.found_inline_types
5614
5616
|> List. map (fun (inline_type_name , loc , kind ) ->
5615
- Ast_helper.Type. mk
5617
+ Ast_helper.Type. mk ~params
5616
5618
~attrs: [(Location. mknoloc " res.inlineRecordDefinition" , PStr [] )]
5617
5619
~loc ~kind
5618
5620
{name with txt = inline_type_name})
0 commit comments