Skip to content

[ModuleInterface] AliasModuleNames workaround support for indirect dependencies and missing imports #62073

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

Merged
merged 3 commits into from
Nov 17, 2022

Conversation

xymus
Copy link
Contributor

@xymus xymus commented Nov 12, 2022

  • In AliasModuleNames, avoid wrongfully printing aliased names for modules that
    were not aliased, just use the real name in that case. This can happen in the case of modules indirectly
    imported via a reexport.
  • If there's a reference in API to a module that's not imported, the
    import is inserted automatically in the swiftinterface. This PR ensures the
    inserted import is correctly aliased in AliasModuleNames mode.

rdar://102262019

@xymus
Copy link
Contributor Author

xymus commented Nov 12, 2022

@swift-ci Please smoke test

…orkaround

If there's a reference in API to a module that's not imported, the
import is inserted automatically in the swiftinterface. This ensures the
inserted import is correctly aliased in AliasModuleNames mode.
@xymus xymus force-pushed the module-alias-disambiguate-more branch from e74b1ca to f14a8eb Compare November 16, 2022 00:30
@xymus
Copy link
Contributor Author

xymus commented Nov 16, 2022

@swift-ci Please smoke test

@xymus
Copy link
Contributor Author

xymus commented Nov 16, 2022

@swift-ci Please smoke test macOS

@xymus xymus requested review from tshortli and elsh November 16, 2022 18:19
struct CType {};

//--- ExportedLib.swift

public struct RexportedStruct {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo Rexported -> Reexported

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I went with Exported to keep in line with the module name.

…irectly

In AliasModuleNames, avoid wrongfully printing aliased names for modules
that were not aliased. This can happen in the case of modules indirectly
imported via a reexport.

rdar://102262019
@xymus xymus force-pushed the module-alias-disambiguate-more branch from f14a8eb to 7ae02c0 Compare November 16, 2022 18:41
@xymus
Copy link
Contributor Author

xymus commented Nov 16, 2022

@swift-ci Please smoke test

@xymus xymus merged commit 888fe84 into swiftlang:main Nov 17, 2022
@xymus xymus deleted the module-alias-disambiguate-more branch November 17, 2022 18:33
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.

2 participants