mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Serialization] Do not accept packages without a name
Realign the module loading behavior with the one of the package access-level. If the package name is an empty string, don't accept other modules with an empty package name as being part of the same module and don't load package dependencies in such a case.
This commit is contained in:
@@ -1712,7 +1712,7 @@ ModuleFileSharedCore::getTransitiveLoadingBehavior(
|
||||
if (dependency.isPackageOnly()) {
|
||||
// Package dependencies are usually loaded only for import from the same
|
||||
// package.
|
||||
if (packageName == getModulePackageName()) {
|
||||
if (!packageName.empty() && packageName == getModulePackageName()) {
|
||||
return ModuleLoadingBehavior::Required;
|
||||
} else if (debuggerMode) {
|
||||
return ModuleLoadingBehavior::Optional;
|
||||
|
||||
Reference in New Issue
Block a user