From 2ccea69194132de1135a9c13a4572b479d20728f Mon Sep 17 00:00:00 2001 From: Mark Shinwell Date: Fri, 22 Oct 2021 08:47:09 +0100 Subject: [PATCH] Backport fix from PR#10719 --- ocaml/lambda/translcore.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ocaml/lambda/translcore.ml b/ocaml/lambda/translcore.ml index 1dffaeb5dc7..aa0177c78ca 100644 --- a/ocaml/lambda/translcore.ml +++ b/ocaml/lambda/translcore.ml @@ -790,7 +790,8 @@ and transl_apply ~scopes let body = match build_apply handle ((Lvar id_arg, optional)::args') l with Lfunction{kind = Curried; params = ids; return; - body = lam; attr; loc} -> + body = lam; attr; loc} + when List.length ids < Lambda.max_arity () -> Lfunction{kind = Curried; params = (id_arg, Pgenval)::ids; return;