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 457909f commit 50f4d60Copy full SHA for 50f4d60
jscomp/test/variantsMatching.js
@@ -1,7 +1,11 @@
1
'use strict';
2
3
4
-function foo(x) {
+function toEnum(x) {
5
+ return x;
6
+}
7
+
8
+function toString(x) {
9
switch (x) {
10
case /* A */0 :
11
return "A";
@@ -114,7 +118,8 @@ function third2(l) {
114
118
}
115
119
116
120
117
-exports.foo = foo;
121
+exports.toEnum = toEnum;
122
+exports.toString = toString;
123
exports.bar = bar;
124
exports.and_ = and_;
125
exports.id = id;
jscomp/test/variantsMatching.res
@@ -1,6 +1,15 @@
type t = A | B | C | D | E
-let foo = x =>
+let toEnum = x =>
+ switch x {
+ | A => 0
+ | B => 1
+ | C => 2
+ | D => 3
+ | E => 4
+ }
12
+let toString = x =>
13
switch x {
14
| A => "A"
15
| B => "B"
0 commit comments