File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -20,14 +20,14 @@ type globalProps = {
20
20
}
21
21
22
22
type anchorProps = {
23
- \ " ..." : globalProps ,
23
+ ... globalProps ,
24
24
download ?: string ,
25
25
href ?: string ,
26
26
target ?: [# _self | # _blank | # _parent | # _top ],
27
27
}
28
28
29
29
// globalProps only case?
30
- type divProps = {\ " ..." : globalProps }
30
+ type divProps = {... globalProps }
31
31
32
32
type svgProps = {
33
33
... globalProps ,
Original file line number Diff line number Diff line change @@ -4975,15 +4975,20 @@ and parseRecordOrObjectDecl p =
4975
4975
(* start of object type spreading, e.g. `type u = {...a, "u": int}` *)
4976
4976
Parser. next p;
4977
4977
let typ = parseTypExpr p in
4978
- let () =
4979
- match p.token with
4980
- | Rbrace ->
4981
- (* {...x}, spread without extra fields *)
4982
- Parser. next p
4983
- | _ -> Parser. expect Comma p
4984
- in
4985
4978
match p.token with
4979
+ | Rbrace ->
4980
+ (* {...x}, spread without extra fields *)
4981
+ Parser. next p;
4982
+ let loc = mkLoc startPos p.prevEndPos in
4983
+ let dotField =
4984
+ Ast_helper.Type. field ~loc
4985
+ {txt = " ..." ; loc = mkLoc dotdotdotStart dotdotdotEnd}
4986
+ typ
4987
+ in
4988
+ let kind = Parsetree. Ptype_record [dotField] in
4989
+ (None , Public , kind)
4986
4990
| _ ->
4991
+ Parser. expect Comma p;
4987
4992
let loc = mkLoc startPos p.prevEndPos in
4988
4993
let dotField =
4989
4994
Ast_helper.Type. field ~loc
You can’t perform that action at this time.
0 commit comments