Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slice2swift Does not Correctly Generate Links to Symbols in Nested Modules #3120

Open
InsertCreativityHere opened this issue Nov 11, 2024 · 1 comment
Assignees
Milestone

Comments

@InsertCreativityHere
Copy link
Member

In Swift, packages are flat, meaning things can only live 1 package deep, there is no notion of "nested packages".
To fix this, any Slice constructs which are within nested modules will have the extra modules rolled into their names. Ex:

["swift:module:Ice:MX]
module IceMX
{
    struct MetricsFailures { ... }
}

will generate a struct named MXMetricsFailures which lives inside the Ice package.

This approach really screws with doc-comments.
Let's say we now do {@link MetricsFailures}. All we see is this string. There's no collision with reserved identifiers or keywords, so we don't change the string, and generate a Swift link to it: ``MetricsFailures``. However, nothing with that name exists. Since it should be mapped to MXMetricsFailures.

@InsertCreativityHere InsertCreativityHere added this to the 3.8.0 milestone Nov 11, 2024
@InsertCreativityHere InsertCreativityHere self-assigned this Nov 11, 2024
@InsertCreativityHere
Copy link
Member Author

I encountered this problem in slice2swift, but I bet that this problem also exists anywhere where users use metadata to map module names to something else. And will become a huge headache once we add xxx:identifier metadata.

So the fix isn't specific to slice2swift, but is instead to perform some kind of type-lookup on any @links, instead of just passing the raw string along. This would also have the added benefit that we could issue warnings for dead links.

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

No branches or pull requests

1 participant