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

Commit a912354

Browse files
mununkicristianoc
authored andcommitted
add loc to props type for better err msg
1 parent c840235 commit a912354

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
@@ -751,7 +751,7 @@ let transformStructureItem ~config mapper item =
751751
in
752752
(* type props<'x, 'y> = { x: 'x, y?: 'y, ... } *)
753753
let propsRecordType =
754-
makePropsRecordType "props" Location.none namedTypeList
754+
makePropsRecordType "props" pstr_loc namedTypeList
755755
in
756756
(* can't be an arrow because it will defensively uncurry *)
757757
let newExternalType =
@@ -975,7 +975,7 @@ let transformStructureItem ~config mapper item =
975975
let vbMatchList = List.map vbMatch namedArgWithDefaultValueList in
976976
(* type props = { ... } *)
977977
let propsRecordType =
978-
makePropsRecordType "props" emptyLoc namedTypeList
978+
makePropsRecordType "props" pstr_loc namedTypeList
979979
in
980980
let innerExpression =
981981
Exp.apply
@@ -1197,7 +1197,7 @@ let transformSignatureItem ~config _mapper item =
11971197
(makePropsTypeParams namedTypeList)
11981198
in
11991199
let propsRecordType =
1200-
makePropsRecordTypeSig "props" Location.none
1200+
makePropsRecordTypeSig "props" psig_loc
12011201
((* If there is Nolabel arg, regard the type as ref in forwardRef *)
12021202
(if !hasForwardRef then [(true, "ref", [], refType Location.none)]
12031203
else [])

0 commit comments

Comments
 (0)