Skip to content

Fix module type strengthen - #1485

Open
jonludlam wants to merge 3 commits into
ocaml:masterfrom
jonludlam:fix-module-type-strengthen
Open

Fix module type strengthen#1485
jonludlam wants to merge 3 commits into
ocaml:masterfrom
jonludlam:fix-module-type-strengthen

Conversation

@jonludlam

Copy link
Copy Markdown
Member

There was some missing logic in the strengthening code around module type aliases. This PR regularises the handling of module and module type aliases, and fixes some broken links.

jonludlam and others added 2 commits September 2, 2026 22:18
[include module type of M], where M belongs to a wrapped library,
re-exports M's module types as paths rather than expanding them. Such a
module type has no expansion of its own, so no page is generated for it,
and references to it have to link to the module type that does have one.

The spec line does. The links from the value that came in through the
same include do not - they point at a page that was never generated. The
expected output below records that.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Strengthening replaces a module type by a path back to the prefix, so it
no longer has an expansion of its own. Paths pointing at it were left
alone, so references resolved to a module type with no page.

Modules already handle this: Strengthen collects the ids it strengthened
and Subst.path_invalidate_module records them in a field of its own, so
that resolved_module_path can re-resolve those paths through the prefix.
Give module types the same treatment.

That path was previously unusable because
Cpath.unresolve_resolved_module_type_path returned `Local unchanged,
where the module version returns the unresolved `Local, so unresolving
an invalidated path looped. Make the two agree.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jonludlam
jonludlam force-pushed the fix-module-type-strengthen branch from 76cb914 to 0e25ba2 Compare September 2, 2026 22:30
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