Skip to content

Commit ccfd480

Browse files
committed
Complete pattern match in the example.
1 parent 25fffaa commit ccfd480

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

jscomp/test/res_debug.js

+2-9
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,9 @@ function testMatch(v) {
1919
var y = v.y;
2020
if (y !== undefined) {
2121
return y;
22+
} else {
23+
return 42;
2224
}
23-
throw {
24-
RE_EXN_ID: "Match_failure",
25-
_1: [
26-
"res_debug.res",
27-
50,
28-
2
29-
],
30-
Error: new Error()
31-
};
3225
}
3326

3427
var v2 = newrecord;

jscomp/test/res_debug.res

+1-3
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,10 @@ let v1 : r = { x : 3
4444
, z : 3
4545
}
4646

47-
@@warning("-8") // Turn off incomplete pattern match
48-
4947
let testMatch = v =>
5048
switch v {
5149
| {y} => y
52-
// | {y: @optional None} => 42
50+
| {y: @optional None} => 42
5351
}
5452

5553
let h = '😊'

0 commit comments

Comments
 (0)