aboutsummaryrefslogtreecommitdiff
path: root/src/Sema.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-06-15 14:08:57 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-06-15 14:08:57 -0700
commit515d6430c0298daf304e48b46e6b43802bbfdab4 (patch)
tree0b67deffdca555ce4deaa0b5fb01e3f1edcfbc9b /src/Sema.zig
parent0f4173c5d834dca2710005ffc1e040a4b307df00 (diff)
downloadzig-515d6430c0298daf304e48b46e6b43802bbfdab4.tar.gz
zig-515d6430c0298daf304e48b46e6b43802bbfdab4.zip
AstGen: support `@export` with field access
The Zig language specification will support identifiers and field access in order to refer to which declaration to export with `@export`. This commit implements the change in AstGen and updates the language reference.
Diffstat (limited to 'src/Sema.zig')
-rw-r--r--src/Sema.zig3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Sema.zig b/src/Sema.zig
index c9a150202e..07c8c3fc26 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -1985,6 +1985,9 @@ fn zirExport(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerError!
const lhs_src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = inst_data.src_node };
const rhs_src: LazySrcLoc = .{ .node_offset_builtin_call_arg1 = inst_data.src_node };
const decl_name = sema.code.nullTerminatedString(extra.decl_name);
+ if (extra.namespace != .none) {
+ return sema.mod.fail(&block.base, src, "TODO: implement exporting with field access", .{});
+ }
const decl = try sema.lookupIdentifier(block, lhs_src, decl_name);
const options = try sema.resolveInstConst(block, rhs_src, extra.options);
const struct_obj = options.ty.castTag(.@"struct").?.data;