Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Fix parsing of arrow type with objects in constructor declaration args #410

Merged
merged 1 commit into from
May 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/res_core.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4396,7 +4396,11 @@ and parseConstrDeclArgs p =
) in
Parser.expect Rbrace p;
let loc = mkLoc startPos p.prevEndPos in
let typ = Ast_helper.Typ.object_ ~loc ~attrs:[] fields closedFlag in
let typ =
Ast_helper.Typ.object_ ~loc ~attrs:[] fields closedFlag
|> parseTypeAlias p
in
let typ = parseArrowTypeRest ~es6Arrow:true ~startPos typ p in
Parser.optional p Comma |> ignore;
let moreArgs =
parseCommaDelimitedRegion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,8 @@ type node <_, 'value> =
updateF: 'value => 'value,
mutable updatedTime: float,
}): node<derived, 'value>

type delta = Compute({"blocked_ids": unit} => unit)
type queryDelta =
| Compute({"blocked_ids": unit} => unit)
| Compute({"blocked_ids": unit} => unit, {"allowed_ids": unit} => unit)
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,10 @@ type nonrec (_, 'value) node =
parent: (_, 'value) node ;
root: (root, 'value) node ;
updateF: 'value -> 'value ;
mutable updatedTime: float } -> (derived, 'value) node
mutable updatedTime: float } -> (derived, 'value) node
type nonrec delta =
| Compute of (< blocked_ids: unit > -> unit)
type nonrec queryDelta =
| Compute of (< blocked_ids: unit > -> unit)
| Compute of (< blocked_ids: unit > -> unit) *
(< allowed_ids: unit > -> unit)