This repository was archived by the owner on Jun 15, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +25
-4
lines changed Expand file tree Collapse file tree 3 files changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -208,20 +208,21 @@ let recordFromProps ~loc ~removeKey callArguments =
208
208
let spreadFields =
209
209
propsToSpread |> List. map (fun (_ , expression ) -> expression)
210
210
in
211
- match spreadFields with
212
- | [] ->
211
+ match (fields, spreadFields) with
212
+ | [] , [spreadProps] | [] , spreadProps :: _ -> spreadProps
213
+ | _ , [] ->
213
214
{
214
215
pexp_desc = Pexp_record (fields, None );
215
216
pexp_loc = loc;
216
217
pexp_attributes = [] ;
217
218
}
218
- | [spreadProps] ->
219
+ | _ , [spreadProps] ->
219
220
{
220
221
pexp_desc = Pexp_record (fields, Some spreadProps);
221
222
pexp_loc = loc;
222
223
pexp_attributes = [] ;
223
224
}
224
- | spreadProps :: _ ->
225
+ | _ , spreadProps :: _ ->
225
226
{
226
227
pexp_desc = Pexp_record (fields, Some spreadProps);
227
228
pexp_loc = loc;
Original file line number Diff line number Diff line change
1
+ let c0 = React.jsx(A.make, {...p, x: "x"})
2
+
3
+ // ignore second one
4
+ let c0 = React.jsx(A.make, {...p0, x: "x"})
5
+
6
+ // only spread props
7
+ let c1 = React.jsx(A.make, p)
8
+
9
+ // reversed order
10
+ let c2 = React.jsx(A.make, {...p, x: "x"})
Original file line number Diff line number Diff line change
1
+ let c0 = <A x = "x" {... p } />
2
+
3
+ // ignore second one
4
+ let c0 = <A x = "x" {... p0 } {... p1 } />
5
+
6
+ // only spread props
7
+ let c1 = <A {... p } />
8
+
9
+ // reversed order
10
+ let c2 = <A {... p } x = "x" />
You can’t perform that action at this time.
0 commit comments