mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Compare the package names of the accessing module and the decl's defining module.
Update tests.
This commit is contained in:
@@ -762,7 +762,7 @@ void UnboundImport::validateInterfaceWithPackageName(ModuleDecl *topLevelModule,
|
||||
|
||||
// If source file is .swift or non-interface, show diags when importing an interface file
|
||||
ASTContext &ctx = topLevelModule->getASTContext();
|
||||
if (topLevelModule->inPackage(ctx.LangOpts.PackageName) &&
|
||||
if (topLevelModule->inSamePackage(ctx.MainModule) &&
|
||||
topLevelModule->isBuiltFromInterface() &&
|
||||
!topLevelModule->getModuleSourceFilename().endswith(".package.swiftinterface")) {
|
||||
ctx.Diags.diagnose(import.module.getModulePath().front().Loc,
|
||||
|
||||
Reference in New Issue
Block a user