Skip to content

Commit 2f35e3a

Browse files
committed
add failing test
1 parent 3c82306 commit 2f35e3a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

jscomp/test/VariantPatternMatchingSpreads.res

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
type a = One | Two | Three
22
type b = | ...a | Four | Five
3+
type c = Six | Seven
4+
type d = | ...b | ...c
35

46
let doWithA = (a: a) => {
57
switch a {
@@ -23,9 +25,9 @@ let lookup = (b: b) =>
2325
| Five => Js.log("five")
2426
}
2527

26-
let lookup2 = (b: b) =>
27-
switch b {
28-
| ...a => Js.log("spread")
29-
| Four => Js.log("four")
30-
| Five => Js.log("five")
28+
let lookup2 = (d: d) =>
29+
switch d {
30+
| ...a as a => doWithA(a)
31+
| ...b as b => doWithB(b)
32+
| Six | Seven => Js.log("Got rest of d")
3133
}

0 commit comments

Comments
 (0)