Add a check for an empty package interface path

Update diags
This commit is contained in:
Ellie Shin
2023-11-14 01:07:28 -08:00
parent 9d716394b1
commit fbdc16d69a
4 changed files with 4 additions and 4 deletions

View File

@@ -641,7 +641,7 @@ SerializedModuleBaseName::findInterfacePath(llvm::vfs::FileSystem &fs, ASTContex
// Check if a package interface exists and if the package name applies to
// the importer module.
auto pkgPath = getPackageInterfacePathIfInSamePackage(fs, ctx).value_or("");
if (fs.exists(pkgPath))
if (!pkgPath.empty() && fs.exists(pkgPath))
return pkgPath;
// If above fails, use the existing logic as fallback.