Skip to content

Fix extended open support - #1482

Open
jonludlam wants to merge 5 commits into
ocaml:masterfrom
jonludlam:upstream-fix-open-struct
Open

Fix extended open support#1482
jonludlam wants to merge 5 commits into
ocaml:masterfrom
jonludlam:upstream-fix-open-struct

Conversation

@jonludlam

Copy link
Copy Markdown
Member

2 related fixes for the "extended opens", with tests. Tests are committed failing then updated in the commit that fixes the behaviour.

jonludlam and others added 5 commits September 2, 2026 18:05
An extended open (`open struct ... end`) that follows the top-of-file
docstring is silently dropped from the loaded signature, so references
to the items it binds fail to resolve.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
extract_tail_alerts dropped open items that followed the top-of-file
docstring, so declarations bound by `open struct ... end` were lost
from the loaded signature. This caused ~76K failed lookups when
linking base on OxCaml, whose container_intf.ml opens a struct of
module aliases after its docstring. The previous commit's test now
resolves its reference.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A path into a top-level extended open resolves via Env within the
defining unit, but from another unit it is looked up structurally via
Find, which does not recurse into Open expansion items.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Give Signature.Open items the same treatment as Include expansions
when searching a signature. Only extended opens bind items, so plain
`open M` is unaffected. Fixes cross-unit resolution of paths into
top-level extended opens (with the previous fix, ~2300 warnings and
~600 pages on OxCaml's core corpus); the previous commit's test now
resolves.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jonludlam
jonludlam force-pushed the upstream-fix-open-struct branch from d03b03e to 1c54c23 Compare September 2, 2026 22:41
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