Skip to content

Conversation

@davesnx
Copy link
Member

@davesnx davesnx commented Jan 17, 2026

On OCaml 4.14, ppxlib converts let f x = (x : int) to Pexp_function with the type constraint attached to the function itself (Some (Pconstraint int)) rather than as a Pexp_constraint wrapping the body.

The curriedPatternsAndReturnVal method returned the whole Pexp_function as the "return value" when a constraint was present, causing infinite recursion when the printer tried to process it again.

The fix was to extract the body expression and wrap it in Pexp_constraint/Pexp_coerce when the function has a constraint, so the printer can process it without recursion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants