Skip to content

Commit 3cc5d11

Browse files
committed
dogfooding more
1 parent 9aab444 commit 3cc5d11

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

jscomp/test/int_poly_var.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,11 @@ function hh1(x) {
159159
}
160160

161161
function f(x) {
162-
return x;
162+
if (x.NAME === 1) {
163+
return x.VAL;
164+
} else {
165+
return String(x.VAL);
166+
}
163167
}
164168

165169
Mt.from_pair_suites("int_poly_var.res", suites.contents);

jscomp/test/int_poly_var.res

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,12 @@ type t0 = [#a | #b]
9090

9191
let f = (x: list<t0>) => (x :> list<Test2.U.H.t>)
9292

93+
type u = [#0(int) | #1(string)]
94+
95+
let f = (x: u) => {
96+
switch x {
97+
| #0(x) => string_of_int(x)
98+
| #1(x) => x
99+
}
100+
}
93101
Mt.from_pair_suites(__FILE__, suites.contents)

0 commit comments

Comments
 (0)