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

Commit 6f69284

Browse files
committed
add loc to pattern
1 parent 1e0f307 commit 6f69284

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cli/reactjs_jsx_v4.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,12 +1016,12 @@ let transformStructureItem ~config mapper item =
10161016
(argToType ~newtypes ~typeConstraints)
10171017
[] namedArgList
10181018
in
1019-
let vbMatch (name, default, _, _, _, _) =
1019+
let vbMatch (name, default, {ppat_loc}, _, _, _) =
10201020
let label = getLabel name in
10211021
match default with
10221022
| Some default ->
10231023
Vb.mk
1024-
(Pat.var (Location.mknoloc label))
1024+
(Pat.var (Location.mkloc label ppat_loc))
10251025
(Exp.match_
10261026
(Exp.ident
10271027
{txt = Ldot (Lident "props", label); loc = Location.none})
@@ -1037,7 +1037,7 @@ let transformStructureItem ~config mapper item =
10371037
])
10381038
| None ->
10391039
Vb.mk
1040-
(Pat.var (Location.mknoloc label))
1040+
(Pat.var (Location.mkloc label ppat_loc))
10411041
(Exp.ident @@ Location.mknoloc @@ Ldot (Lident "props", label))
10421042
in
10431043
let vbMatchList =

0 commit comments

Comments
 (0)