diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-06-15 14:08:57 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-06-15 14:08:57 -0700 |
| commit | 515d6430c0298daf304e48b46e6b43802bbfdab4 (patch) | |
| tree | 0b67deffdca555ce4deaa0b5fb01e3f1edcfbc9b /src/Sema.zig | |
| parent | 0f4173c5d834dca2710005ffc1e040a4b307df00 (diff) | |
| download | zig-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.zig | 3 |
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; |
