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 7b6f4bd commit 559f0d7Copy full SHA for 559f0d7
compiler/tests-compiler/static_eval.ml
@@ -157,3 +157,36 @@ let%expect_test "static eval of string get" =
157
}
158
159
//end |}]
160
+
161
+let%expect_test "static eval of tags" =
162
+ let program =
163
+ compile_and_parse
164
+ {|
165
166
+ type t = A | B | C of t | D of t
167
168
+ let foobar =
169
+ let x = C (D A) in
170
+ match x with
171
+ | A -> 1
172
+ | B -> 2
173
+ | C _ -> 2
174
+ | D _ -> 3
175
176
+ let export = [|foobar;foobar|]
177
+ |}
178
+ in
179
+ print_program program;
180
+ [%expect
181
182
+ (function(globalThis){
183
+ "use strict";
184
+ var
185
+ runtime = globalThis.jsoo_runtime,
186
+ export$0 = [0, 2, 2],
187
+ Test = [0, 2, export$0];
188
+ runtime.caml_register_global(1, Test, "Test");
189
+ return;
190
+ }
191
+ (globalThis));
192
+ //end |}]
0 commit comments