ModuleInterface: Don't warn on name conflict when the alias workaround is enabled

This warning is designed to be an early report of name conflicts in
swiftinterfaces caused by a type having the same name as a module.
Make sure we silence this warning when the workaround
-alias-module-names-in-module-interface is enabled. This is what we
already do for -module-interface-preserve-types-as-written.

rdar://132990400
This commit is contained in:
Alexis Laferrière
2024-08-02 14:44:20 -07:00
parent 1311a8097d
commit b4fb5720b2
2 changed files with 6 additions and 1 deletions

View File

@@ -163,7 +163,8 @@ static void
diagnoseDeclShadowsModule(ModuleInterfaceOptions const &Opts,
TypeDecl *shadowingDecl, ModuleDecl *shadowedModule,
ModuleDecl *brokenModule) {
if (Opts.PreserveTypesAsWritten || shadowingDecl == shadowedModule)
if (Opts.PreserveTypesAsWritten || Opts.AliasModuleNames ||
shadowingDecl == shadowedModule)
return;
shadowingDecl->diagnose(