Skip to content

Fix broken test for hidden paths - #1484

Open
jonludlam wants to merge 3 commits into
ocaml:masterfrom
jonludlam:fix-shadowed-type-hidden
Open

Fix broken test for hidden paths#1484
jonludlam wants to merge 3 commits into
ocaml:masterfrom
jonludlam:fix-shadowed-type-hidden

Conversation

@jonludlam

Copy link
Copy Markdown
Member

We were only checking if a type's parent was hidden, not the type's name itself.

jonludlam and others added 3 commits September 2, 2026 19:47
When two items in a signature share a name, odoc renames the shadowed one
so it keeps a unique identifier. That name is internal and must never
reach the output.

The compiler only allows the shadowing when the shadowed item stays
re-expressible - here it is [int], and [M.R]'s destructive substitution
still refers to it - so odoc has everything it needs to print [int].

This test shows it doesn't: the substitution and the value that uses it
both render as the internal disambiguated name instead. The expected
output below records that broken behaviour.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Cpath.is_resolved_type_hidden only looked at the parent of a `Type path,
so a hidden or shadowed type name under a visible parent was reported as
not hidden. Its Lang counterpart, Paths.Path.Resolved.is_hidden, does
check the name; the two had drifted apart.

Link.type_expression uses the Cpath predicate to decide whether to
replace a hidden type path with the type's definition, and the generator
uses the Lang one to decide how to render what's left. Disagreeing meant
the substitution was skipped and the path was then printed as an
unresolved reference, spelled with odoc's internal disambiguated name.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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