Skip to content

Add the return type constraint for Jsx.addKeyProp #5670

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 19, 2022
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
8 changes: 4 additions & 4 deletions jscomp/main/builtin_cmi_datasets.ml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions jscomp/main/builtin_cmj_datasets.ml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions jscomp/others/jsx.ml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ type 'props component = ('props, element) componentLike
external component : ('props, element) componentLike -> 'props component
= "%identity"

let addKeyProp (o : 't) (k : string) =
let addKeyProp (p : 'props) (k : string) : 'props =
(* Use Js_obj.assign, not Js.Obj.assign, otherwise the dependency will not be picked up correctly
in the ninja file. *)
Obj.magic (Js_obj.assign (Obj.magic o) [%obj { key = k }])
Obj.magic (Js_obj.assign (Obj.magic p) [%obj { key = k }])
[@@inline]
12 changes: 6 additions & 6 deletions lib/4.06.1/unstable/js_compiler.ml

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions lib/4.06.1/unstable/js_playground_compiler.ml

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions lib/4.06.1/whole_compiler.ml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/es6/jsx.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@



function addKeyProp(o, k) {
return Object.assign(o, {
function addKeyProp(p, k) {
return Object.assign(p, {
key: k
});
}
Expand Down
4 changes: 2 additions & 2 deletions lib/js/jsx.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';


function addKeyProp(o, k) {
return Object.assign(o, {
function addKeyProp(p, k) {
return Object.assign(p, {
key: k
});
}
Expand Down