Conversation
DZakh
commented
Jul 5, 2022
Comment on lines
+141
to
+144
| return "Invalid union with following errors" + lineBreak + "" + reasons.join(lineBreak) + ""; | ||
|
|
||
| } | ||
| return "Expected " + reason.expected + ", received " + reason.received; | ||
| return "Expected " + reason.expected + ", received " + reason.received + ""; |
Owner
Author
There was a problem hiding this comment.
Started adding empty strings around values in template literal.
There was a problem hiding this comment.
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?
Owner
Author
There was a problem hiding this comment.
I've created an issue rescript-lang/rescript#5521
DZakh
commented
Jul 5, 2022
| 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 + ""; |
Owner
Author
There was a problem hiding this comment.
Here it joined to string values on compile-time, that's super cool!
([ReScript Struct] and Failed)
DZakh
commented
Jul 5, 2022
Comment on lines
415
to
+418
| valueRef.contents = newValue | ||
| idxRef.contents = idxRef.contents->Lib.Int.plus(1) | ||
| } | ||
|
|
Owner
Author
There was a problem hiding this comment.
A forced new line after switch case with code block looks off to me
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.