Skip to content

Commit c8a8e08

Browse files
committed
Use value from as attribute if available
1 parent 6d78c58 commit c8a8e08

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

jscomp/core/lam_constant_convert.ml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ let rec convert_constant (const : Lambda.structured_constant) : Lam_constant.t =
5050
Const_int { i = Int32.of_int i; comment = Pt_assertfalse }
5151
| Pt_constructor { name; const; non_const; attrs } ->
5252
let tag_type = Ast_untagged_variants.process_tag_type attrs in
53+
let i = match tag_type with
54+
| Some(Ast_untagged_variants.Int(v)) -> v
55+
| _ -> i in
5356
Const_int
5457
{
5558
i = Int32.of_int i;

0 commit comments

Comments
 (0)