File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -184,7 +184,8 @@ static void
184184diagnoseDeclShadowsModule (ModuleInterfaceOptions const &Opts,
185185 TypeDecl *shadowingDecl, ModuleDecl *shadowedModule,
186186 ModuleDecl *brokenModule) {
187- if (Opts.PreserveTypesAsWritten || shadowingDecl == shadowedModule)
187+ if (Opts.PreserveTypesAsWritten || Opts.AliasModuleNames ||
188+ shadowingDecl == shadowedModule)
188189 return ;
189190
190191 shadowingDecl->diagnose (
Original file line number Diff line number Diff line change 1515// RUN: %empty-directory(%t/subtest-2)
1616// RUN: %target-swift-frontend -typecheck -parse-stdlib -module-cache-path %t/mcp -emit-module-interface-path %t/subtest-2/module_shadowing.swiftinterface %s -enable-library-evolution -module-name module_shadowing -I %t/lib -module-interface-preserve-types-as-written -swift-version 5 -verify
1717
18+ // alias-module-names-in-module-interface also disables this warning.
19+ // RUN: %empty-directory(%t/subtest-2)
20+ // RUN: %target-swift-frontend -typecheck -parse-stdlib -module-cache-path %t/mcp -emit-module-interface-path %t/subtest-2/module_shadowing.swiftinterface %s -enable-library-evolution -module-name module_shadowing -I %t/lib -alias-module-names-in-module-interface -swift-version 5 -verify
21+
1822// Build this module in a different configuration where it will shadow itself.
1923// RUN: %empty-directory(%t/subtest-3)
2024// RUN: %target-swift-frontend -typecheck -parse-stdlib -module-cache-path %t/mcp -emit-module-interface-path %t/subtest-3/ShadowyHorror.swiftinterface %s -enable-library-evolution -module-name ShadowyHorror -DSELF_SHADOW -swift-version 5 2>&1 | %FileCheck --check-prefix SELF --implicit-check-not TestModule %s
You can’t perform that action at this time.
0 commit comments