Skip to content
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

Prevent fatal compiler error with unboxing code and GADTs #1578

Merged
merged 3 commits into from
Jul 25, 2023
Merged
Changes from 1 commit
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
10 changes: 2 additions & 8 deletions middle_end/flambda2/simplify/unboxing/unboxing_epa.ml
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,8 @@ let extra_args_for_const_ctor_of_variant
(const_ctors_decision : U.const_ctors_decision) ~typing_env_at_use
rewrite_id variant_arg : U.const_ctors_decision =
match const_ctors_decision with
| Zero -> (
match variant_arg with
| Not_a_constant_constructor -> const_ctors_decision
| Maybe_constant_constructor _ ->
Misc.fatal_errorf
"The unboxed variant parameter was determined to have no constant \
cases when deciding to unbox it (using the parameter type), but at \
the use site, it is a constant constructor.")
| Zero ->
const_ctors_decision
chambart marked this conversation as resolved.
Show resolved Hide resolved
| At_least_one { ctor = Do_not_unbox reason; is_int } ->
let is_int =
Extra_param_and_args.update_param_args is_int rewrite_id
Expand Down