Skip to content

Commit

Permalink
restrict pair creation
Browse files Browse the repository at this point in the history
  • Loading branch information
ggreif committed Aug 5, 2024
1 parent 261ae02 commit 0b99d03
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/codegen/compile.ml
Original file line number Diff line number Diff line change
Expand Up @@ -10640,9 +10640,10 @@ and compile_prim_invocation (env : E.t) ae p es at =
code1 ^^ StackRep.adjust env fun_sr SR.Vanilla ^^
Closure.prepare_closure_call env ^^ (* FIXME: move to front elsewhere too *)
set_clos ^^
Type.(match as_obj par.note.Note.typ with
| Object, [] -> get_clos (* just the closure *)
| _ -> Arr.lit env [compile_exp_vanilla env ae par; get_clos]) ^^ (* parenthetical: pass a pair *)
Type.(match as_obj par.note.Note.typ, ret_tys with
| (Object, []), _ -> get_clos (* just the closure *)
| _, [ret] when Type.is_async ret -> Arr.lit env [compile_exp_vanilla env ae par; get_clos] (* parenthetical: pass a pair *)
| _ -> get_clos) ^^ (* just the closure *)
compile_exp_as env ae (StackRep.of_arity n_args) e2 ^^
get_clos ^^
Closure.call_closure env n_args return_arity
Expand Down

0 comments on commit 0b99d03

Please sign in to comment.