-
Notifications
You must be signed in to change notification settings - Fork 477
Closed as not planned
Labels
staleOld issues that went staleOld issues that went stale
Description
Thanks to the PR #6412, we can rename the returned js object key name. But I found little inconsistent with the exisiting @as usage on record.
type t0 = {@as("a") type_: string}
@obj
external make: (@as("b") ~type_: string=?) => t0 = ""
let t0 = { type_: "t0"}
let t1 = make(~type_="t1")
let make = makegenerated to
var t0 = {
a: "t0"
};
var t1 = {
b: "t1" // shouldn't be a?
};
function make(prim) {
var tmp = {};
if (prim !== undefined) {
tmp.b = prim; // shouldn't be tmp.a = prim?
}
return tmp;
}IMO, @as("b") would make rename the argument to b, but not affecting the returned value that needs to be kept a by @as("a")
What do you think? @DZakh
Metadata
Metadata
Assignees
Labels
staleOld issues that went staleOld issues that went stale