stage2: slightly improve error reporting for missing imports
There is now a distinction between `@import` with a .zig extension and without. Without a .zig extension it assumes it is a package name, and returns error.PackageNotFound if not mapped into the package table.
This commit is contained in:
@@ -3185,6 +3185,9 @@ pub fn importFile(
|
||||
if (cur_file.pkg.table.get(import_string)) |pkg| {
|
||||
return mod.importPkg(pkg);
|
||||
}
|
||||
if (!mem.endsWith(u8, import_string, ".zig")) {
|
||||
return error.PackageNotFound;
|
||||
}
|
||||
const gpa = mod.gpa;
|
||||
|
||||
// The resolved path is used as the key in the import table, to detect if
|
||||
|
||||
Reference in New Issue
Block a user