diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-02-21 11:43:31 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-21 11:43:31 -0500 |
| commit | 7f691b3fe26f623d108a6b2b2018bbc3aa999224 (patch) | |
| tree | 81814816cfde6610a4b965d9d3799de3cb3eaccd /src/Sema.zig | |
| parent | 05da5b32a820c031001098034840940964f41a81 (diff) | |
| parent | f94cbab3acc3b31464f45872c1f700874eecb23e (diff) | |
| download | zig-7f691b3fe26f623d108a6b2b2018bbc3aa999224.tar.gz zig-7f691b3fe26f623d108a6b2b2018bbc3aa999224.zip | |
Merge pull request #14664 from mlugg/feat/new-module-cli
New module CLI
Diffstat (limited to 'src/Sema.zig')
| -rw-r--r-- | src/Sema.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Sema.zig b/src/Sema.zig index 40a4a114b4..46b47cd23d 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -5311,7 +5311,6 @@ fn zirCImport(sema: *Sema, parent_block: *Block, inst: Zir.Inst.Index) CompileEr } const c_import_pkg = Package.create( sema.gpa, - "c_import", // TODO: should we make this unique? null, c_import_res.out_zig_path, ) catch |err| switch (err) { @@ -11793,8 +11792,9 @@ fn zirImport(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air. return sema.fail(block, operand_src, "import of file outside package path: '{s}'", .{operand}); }, error.PackageNotFound => { - const cur_pkg = block.getFileScope().pkg; - return sema.fail(block, operand_src, "no package named '{s}' available within package '{s}'", .{ operand, cur_pkg.name }); + const name = try block.getFileScope().pkg.getName(sema.gpa, mod.*); + defer sema.gpa.free(name); + return sema.fail(block, operand_src, "no package named '{s}' available within package '{s}'", .{ operand, name }); }, else => { // TODO: these errors are file system errors; make sure an update() will |
