We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9aab444 commit 3cc5d11Copy full SHA for 3cc5d11
jscomp/test/int_poly_var.js
@@ -159,7 +159,11 @@ function hh1(x) {
159
}
160
161
function f(x) {
162
- return x;
+ if (x.NAME === 1) {
163
+ return x.VAL;
164
+ } else {
165
+ return String(x.VAL);
166
+ }
167
168
169
Mt.from_pair_suites("int_poly_var.res", suites.contents);
jscomp/test/int_poly_var.res
@@ -90,4 +90,12 @@ type t0 = [#a | #b]
90
91
let f = (x: list<t0>) => (x :> list<Test2.U.H.t>)
92
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
+}
101
Mt.from_pair_suites(__FILE__, suites.contents)
0 commit comments