Fix broken test for hidden paths - #1484
Open
jonludlam wants to merge 3 commits into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We were only checking if a type's parent was hidden, not the type's name itself.