File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed
tests/parsing/grammar/modtype Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -6269,12 +6269,16 @@ and parse_with_constraint p =
6269
6269
(Location. mkloc (Longident. last type_constr.txt) type_constr.loc) )
6270
6270
| Equal ->
6271
6271
Parser. next p;
6272
+ let private_flag =
6273
+ if Parser. optional p Token. Private then Asttypes. Private
6274
+ else Asttypes. Public
6275
+ in
6272
6276
let typ_expr = parse_typ_expr p in
6273
6277
let type_constraints = parse_type_constraints p in
6274
6278
Parsetree. Pwith_type
6275
6279
( type_constr,
6276
- Ast_helper.Type. mk ~loc: type_constr.loc ~params ~manifest: typ_expr
6277
- ~cstrs: type_constraints
6280
+ Ast_helper.Type. mk ~loc: type_constr.loc ~priv: private_flag ~params
6281
+ ~manifest: typ_expr ~ cstrs: type_constraints
6278
6282
(Location. mkloc (Longident. last type_constr.txt) type_constr.loc) )
6279
6283
| token ->
6280
6284
(* TODO: revisit *)
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ module type A =
9
9
(Foo with type t = 'st constraint 'st = int constraint 'x = int and type
10
10
t = 'st constraint 'st = int constraint 'x = int and type t =
11
11
'st constraint 'st = int constraint 'x = int)
12
+ module type A = (Foo with type t = private string)
12
13
module type A = (Foo with type t := string)
13
14
module type A = (Foo with type 'a t := string)
14
15
module type A = (Foo with type ('a,'b) t := string)
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ module type A = Foo
8
8
with type t = 'st constraint 'st = int constraint 'x = int
9
9
and type t = 'st constraint 'st = int constraint 'x = int
10
10
and type t = 'st constraint 'st = int constraint 'x = int
11
+ module type A = Foo with type t = private string
11
12
12
13
module type A = Foo with type t := string
13
14
module type A = Foo with type t <'a > := string
You can’t perform that action at this time.
0 commit comments