Closed
Description
When compiling rescript-schema with v12 alpha.3, I noticed invalid output. Simplified, the problem is this:
In v11, the following ReScript code:
type error
let reason = (error: error, ~nestedLevel as _ = ?): string => String.make(error)
let reason: error => string = Obj.magic(reason)
let message = (error: error) => `Failed reason: ${error->reason}`
compiles to
function reason(error, param) {
return String(error);
}
function message(error) {
return "Failed reason: " + reason(error);
}
whereas in v12 alpha, it compiles to the invalid code
function reason(error, param) {
return String(error);
}
function message(error) {
return "Failed reason: " + param => reason(error, param);
}
/cc @cristianoc @cometkim
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Done