-
Notifications
You must be signed in to change notification settings - Fork 9
Use rescript@v10 #1
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
Conversation
return "Invalid union with following errors" + lineBreak + "" + reasons.join(lineBreak) + ""; | ||
|
||
} | ||
return "Expected " + reason.expected + ", received " + reason.received; | ||
return "Expected " + reason.expected + ", received " + reason.received + ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Started adding empty strings around values in template literal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't seem to repro:
// tst.res
let template = (nestedLevel, reasons, foo) => {
let lineBreak = `\n${" "->Js.String2.repeat(nestedLevel * 2)}`
`Invalid union with following errors${lineBreak}${reasons->Js.Array2.joinWith(lineBreak)}`
}
gives
// Generated by ReScript, PLEASE EDIT WITH CARE
'use strict';
function template(nestedLevel, reasons, foo) {
var lineBreak = "\n" + " ".repeat((nestedLevel << 1));
return "Invalid union with following errors" + lineBreak + reasons.join(lineBreak);
}
exports.template = template;
/* No side effect */
Would you open an issue with a self-contained repro?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've created an issue rescript-lang/rescript#5521
} | ||
|
||
function toString(error) { | ||
var match = error.operation; | ||
var operation = match ? "parsing" : "serializing"; | ||
var reason = toReason(undefined, error); | ||
var pathText = formatPath(error.path); | ||
return "[ReScript Struct]" + " Failed " + operation + " at " + pathText + ". Reason: " + reason; | ||
return "[ReScript Struct] Failed " + operation + " at " + pathText + ". Reason: " + reason + ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here it joined to string values on compile-time, that's super cool!
([ReScript Struct]
and Failed
)
valueRef.contents = newValue | ||
idxRef.contents = idxRef.contents->Lib.Int.plus(1) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A forced new line after switch case with code block looks off to me
No description provided.