Skip to content

Commit f2b49a9

Browse files
committed
Fix crash when -bs-g is used on untagged variants.
See #6496 While deprecation is being discussed, this prevents the compiler crashes.
1 parent 75afc52 commit f2b49a9

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Pass the rewatch exit code through in wrapper script. https://github.com/rescript-lang/rescript/pull/7565
1919
- Prop punning when types don't match results in I/O error: _none_: No such file or directory. https://github.com/rescript-lang/rescript/pull/7533
2020
- Pass location to children prop in jsx ppx. https://github.com/rescript-lang/rescript/pull/7540
21+
- Fix crash when `bs-g` is used with untagged variants. https://github.com/rescript-lang/rescript/pull/7575
2122

2223
#### :nail_care: Polish
2324

compiler/core/js_dump.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,8 @@ and expression_desc cxt ~(level : int) f x : cxt =
949949
| false, 1 -> Js_op.Lit Literals.tl
950950
| _ -> Js_op.Lit ("_" ^ string_of_int i)),
951951
e ))
952-
(if !Js_config.debug && not_is_cons then [(name_symbol, E.str p.name)]
952+
(if !Js_config.debug && (not untagged) && not_is_cons then
953+
[(name_symbol, E.str p.name)]
953954
else [])
954955
in
955956
if untagged || (not_is_cons = false && p.num_nonconst = 1) then tails

0 commit comments

Comments
 (0)