mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Currently it errors when loading a module built from interface if it has package-name.
This disallows building an interface file that imports such module which should be allowed since interface does not contain package symbols unless usableFromInline or inlinable. This change limits erroring only when building a .swift file. Resolves rdar://108633068
This commit is contained in:
@@ -804,15 +804,6 @@ LoadedFile *SerializedModuleLoaderBase::loadAST(
|
||||
if (loadedModuleFile->isConcurrencyChecked())
|
||||
M.setIsConcurrencyChecked();
|
||||
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());
|
||||
|
||||
Reference in New Issue
Block a user