Skip to content

Commit 019cbce

Browse files
authored
ReScript 12 compatibility workaround (#93)
1 parent 6fe25ef commit 019cbce

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/S_Core.bs.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2356,6 +2356,10 @@ function reason(error, nestedLevelOpt) {
23562356
}
23572357
}
23582358

2359+
function reason$1(error) {
2360+
return reason(error, undefined);
2361+
}
2362+
23592363
function message(error) {
23602364
var match = error.operation;
23612365
var operation;
@@ -2379,7 +2383,7 @@ function message(error) {
23792383
}
23802384
var nonEmptyPath = error.path;
23812385
var pathText = nonEmptyPath === "" ? "root" : nonEmptyPath;
2382-
return "Failed " + operation + " at " + pathText + ". Reason: " + reason(error);
2386+
return "Failed " + operation + " at " + pathText + ". Reason: " + reason(error, undefined);
23832387
}
23842388

23852389
function internalInline(schema, maybeVariant, param) {
@@ -3087,7 +3091,7 @@ var $$Error$1 = {
30873091
make: make$1,
30883092
raise: raise$1,
30893093
message: message,
3090-
reason: reason
3094+
reason: reason$1
30913095
};
30923096

30933097
var Literal = {

src/S_Core.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3473,7 +3473,7 @@ module Error = {
34733473
}
34743474
}
34753475

3476-
let reason = reason->(Obj.magic: ((error, ~nestedLevel: int=?) => string) => error => string)
3476+
let reason = error => reason(error)
34773477

34783478
let message = (error: error) => {
34793479
let operation = switch error.operation {

0 commit comments

Comments
 (0)