mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
- Do not load modules of the same package if built from interface.
- Show diagnostics with an interface path Resolves rdar://104617990
This commit is contained in:
@@ -798,8 +798,18 @@ LoadedFile *SerializedModuleLoaderBase::loadAST(
|
||||
M.setABIName(Ctx.getIdentifier(loadedModuleFile->getModuleABIName()));
|
||||
if (loadedModuleFile->isConcurrencyChecked())
|
||||
M.setIsConcurrencyChecked();
|
||||
if (!loadedModuleFile->getModulePackageName().empty())
|
||||
if (!loadedModuleFile->getModulePackageName().empty()) {
|
||||
if (loadedModuleFile->isBuiltFromInterface() &&
|
||||
loadedModuleFile->getModulePackageName().str() == Ctx.LangOpts.PackageName) {
|
||||
Ctx.Diags.diagnose(SourceLoc(),
|
||||
diag::in_package_module_not_compiled_from_source,
|
||||
M.getBaseIdentifier(),
|
||||
Ctx.LangOpts.PackageName,
|
||||
loadedModuleFile->getModuleSourceFilename()
|
||||
);
|
||||
}
|
||||
M.setPackageName(Ctx.getIdentifier(loadedModuleFile->getModulePackageName()));
|
||||
}
|
||||
M.setUserModuleVersion(loadedModuleFile->getUserModuleVersion());
|
||||
for (auto name: loadedModuleFile->getAllowableClientNames()) {
|
||||
M.addAllowableClientName(Ctx.getIdentifier(name));
|
||||
|
||||
Reference in New Issue
Block a user