Skip to content

Commit

Permalink
Fix cont substitution on named expressions
Browse files Browse the repository at this point in the history
Now, array.ml passes (if the .mli is not included).
For some reason, including the signatures in .mli seems to trigger
a different behavior? Something mysterious is happening.
  • Loading branch information
euisuny committed May 2, 2024
1 parent 2ef1603 commit d8f8ec1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion middle_end/flambda2/validate/normalize.ml
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,15 @@ let rec subst_cont (cont_e1: core_exp) (k: Bound_continuation.t)
Expr.create_handler
(Core_continuation_handler.create args cont_e2)
else cont_e1
| Named (Set_of_closures e) ->
let e = set_of_closures_fix (fun e -> subst_cont e k args cont_e2) e in
Set_of_closures e |> Expr.create_named
| Named (Static_consts e) ->
static_const_group_fix (fun e -> subst_cont e k args cont_e2) e
| Named (Prim e) ->
prim_fix (fun e -> subst_cont e k args cont_e2) e
| Named (Literal (Simple _ | Slot _ | Res_cont Never_returns | Code_id _)
| Prim _ | Closure_expr _ | Set_of_closures _ | Static_consts _
| Closure_expr _
| Rec_info _) -> cont_e1
| Let e ->
let_fix (fun e -> subst_cont e k args cont_e2) e
Expand Down

0 comments on commit d8f8ec1

Please sign in to comment.