Skip to content

Conversation

@NathanReb
Copy link
Collaborator

I'd like to add some basic tests for this before we merge but it's basically a copy of the code that's handling the same conversion in the 5.0 -> 5.1 migration.

@NathanReb NathanReb marked this pull request as ready for review September 16, 2025 09:05
@NathanReb
Copy link
Collaborator Author

I couldn't figure out a proper test for the coercion case and I suspect the logic to convert coercion expression is faulty or at the very least too restrictive.

I'm marking this as ready for review as I don't have a lot of time to spend on ppxlib atm and would still like to be able to release 0.36.2 and 0.37 shortly.

I'll open an issue regarding the conversion to the coercion constraint!

@NathanReb NathanReb force-pushed the ast-builder-ppat-constraint-to-pvb-constraint branch from e516f47 to c5ec60f Compare September 16, 2025 09:10
@NathanReb
Copy link
Collaborator Author

Actually I just need to factor out the code between the migration and Ast_builder so that they share the pat -> expr -> pvb_constraint * pat * expr logic!

@NathanReb NathanReb force-pushed the ast-builder-ppat-constraint-to-pvb-constraint branch from c5ec60f to 300f724 Compare September 22, 2025 12:45
@NathanReb
Copy link
Collaborator Author

Nevermind, it can't easily be shared as they're manipulating different types. It's probably not worth investing too much time on functorizing this just to share that bit of code.

This is ready for review if anyone has spare cycles.

I'll fix the coercion case later on as this would already be very valuable to release.

Signed-off-by: Nathan Rebours <[email protected]>
@NathanReb NathanReb force-pushed the ast-builder-ppat-constraint-to-pvb-constraint branch from 5c44b95 to 8bb5ce1 Compare September 25, 2025 09:00
Nathan Rebours added 2 commits September 25, 2025 16:05
@NathanReb NathanReb force-pushed the ast-builder-ppat-constraint-to-pvb-constraint branch from 8bb5ce1 to 6ac0849 Compare September 25, 2025 14:05
@NathanReb NathanReb merged commit 0d46b8d into ocaml-ppx:0.36 Sep 25, 2025
3 of 5 checks passed
NathanReb pushed a commit to NathanReb/opam-repository that referenced this pull request Oct 1, 2025
CHANGES:

- Make Ast_builder's default `value_binding` constructor generate the proper
  `pvb_constraint` from the pattern and expression arguments.
  (ocaml-ppx/ppxlib#589, @NathanReb)
- Fix pprintast to output correct syntax from `Ppat_constraint (pat, Ptyp_poly ...)`
  nodes until they are completely dropped. (ocaml-ppx/ppxlib#588, @NathanReb)
NathanReb pushed a commit to NathanReb/opam-repository that referenced this pull request Oct 1, 2025
CHANGES:

- Make Ast_builder's default `value_binding` constructor generate the proper
  `pvb_constraint` from the pattern and expression arguments.
  (ocaml-ppx/ppxlib#589, @NathanReb)
- Fix pprintast to output correct syntax from `Ppat_constraint (pat, Ptyp_poly ...)`
  nodes until they are completely dropped. (ocaml-ppx/ppxlib#588, @NathanReb)
mtelvers pushed a commit to mtelvers/opam-repository that referenced this pull request Oct 1, 2025
CHANGES:

- Make Ast_builder's default `value_binding` constructor generate the proper
  `pvb_constraint` from the pattern and expression arguments.
  (ocaml-ppx/ppxlib#589, @NathanReb)
- Fix pprintast to output correct syntax from `Ppat_constraint (pat, Ptyp_poly ...)`
  nodes until they are completely dropped. (ocaml-ppx/ppxlib#588, @NathanReb)
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.

1 participant