Skip to content

Fix crash when -bs-g is used on untagged variants. #7575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Pass the rewatch exit code through in wrapper script. https://github.com/rescript-lang/rescript/pull/7565
- 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
- Pass location to children prop in jsx ppx. https://github.com/rescript-lang/rescript/pull/7540
- Fix crash when `bs-g` is used with untagged variants. https://github.com/rescript-lang/rescript/pull/7575

#### :nail_care: Polish

Expand Down
3 changes: 2 additions & 1 deletion compiler/core/js_dump.ml
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,8 @@ and expression_desc cxt ~(level : int) f x : cxt =
| false, 1 -> Js_op.Lit Literals.tl
| _ -> Js_op.Lit ("_" ^ string_of_int i)),
e ))
(if !Js_config.debug && not_is_cons then [(name_symbol, E.str p.name)]
(if !Js_config.debug && (not untagged) && not_is_cons then
[(name_symbol, E.str p.name)]
else [])
in
if untagged || (not_is_cons = false && p.num_nonconst = 1) then tails
Expand Down
Loading