Skip to content

Remove extra copy_module_type from pmty_with migration from 504 to 503#644

Merged
NathanReb merged 1 commit into
ocaml-ppx:mainfrom
smuenzel:remove-duplicate-copy
Jun 22, 2026
Merged

Remove extra copy_module_type from pmty_with migration from 504 to 503#644
NathanReb merged 1 commit into
ocaml-ppx:mainfrom
smuenzel:remove-duplicate-copy

Conversation

@smuenzel

Copy link
Copy Markdown
Contributor

In astlib/migrate_504_503.ml, when migrating Pmty_with, the module type is copied twice.

This can be especially bad with many nested with constraints, such as https://github.com/janestreet/base/blob/259754a4a8601a1c59a9dcf2baf008e2a90d54fd/src/import0.ml#L5-L42, seemingly leading to a double copying at every constraint.

This error was found with claude code.

Signed-off-by: Stefan Muenzel <source@s.muenzel.net>
@smuenzel smuenzel force-pushed the remove-duplicate-copy branch from cde8606 to b72234b Compare June 21, 2026 13:41
@smuenzel smuenzel marked this pull request as ready for review June 21, 2026 13:51

@NathanReb NathanReb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@NathanReb NathanReb merged commit fd1434b into ocaml-ppx:main Jun 22, 2026
7 of 8 checks passed
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