@@ -777,10 +777,13 @@ and simplify_apply env r ~(apply : Flambda.apply) : Flambda.t * R.t =
777
777
~function_decls ~lhs_of_application ~closure_id_being_applied
778
778
~function_decl ~value_set_of_closures ~dbg ~reg_close ~mode
779
779
~inlined_requested ~specialise_requested ~result_layout
780
- else if nargs > 0 && nargs < arity then
780
+ else if nargs > 0 && nargs < arity then begin
781
+ assert (Lambda. compatible_layout Lambda. layout_function
782
+ result_layout);
781
783
simplify_partial_application env r ~lhs_of_application
782
784
~closure_id_being_applied ~function_decl ~args ~mode ~dbg
783
- ~inlined_requested ~specialise_requested ~result_layout
785
+ ~inlined_requested ~specialise_requested
786
+ end
784
787
else
785
788
Misc. fatal_errorf " Function with arity %d when simplifying \
786
789
application expression: %a"
@@ -809,7 +812,7 @@ and simplify_full_application env r ~function_decls ~lhs_of_application
809
812
810
813
and simplify_partial_application env r ~lhs_of_application
811
814
~closure_id_being_applied ~function_decl ~args ~mode ~dbg
812
- ~inlined_requested ~specialise_requested ~ result_layout
815
+ ~inlined_requested ~specialise_requested
813
816
=
814
817
let arity = A. function_arity function_decl in
815
818
assert (arity > List. length args);
@@ -867,10 +870,9 @@ and simplify_partial_application env r ~lhs_of_application
867
870
inlined = Default_inlined ;
868
871
specialise = Default_specialise ;
869
872
probe = None ;
870
- result_layout;
873
+ result_layout = function_decl. A. return_layout ;
871
874
}
872
875
in
873
- assert (Lambda. compatible_layout function_decl.A. return_layout result_layout);
874
876
let closure_variable =
875
877
Variable. rename ~debug_info: (Closure_id. debug_info closure_id_being_applied)
876
878
(Closure_id. unwrap closure_id_being_applied)
0 commit comments