aboutsummaryrefslogtreecommitdiff
path: root/src/Module.zig
diff options
context:
space:
mode:
authorMeghan Denny <hello@nektro.net>2021-10-16 22:49:51 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-10-17 21:42:22 -0700
commit0ef2e2520af59a42014399282ddea983fa526449 (patch)
treeb186116f3064299d58a81cacb2f68ae492d26d65 /src/Module.zig
parent7d0a74456b0f239e6cc8532143badeb6781bd47d (diff)
downloadzig-0ef2e2520af59a42014399282ddea983fa526449.tar.gz
zig-0ef2e2520af59a42014399282ddea983fa526449.zip
stage2: implement `@hasField`
struct and union are kept in stage1 because struct/unionFieldCount are returning zero
Diffstat (limited to 'src/Module.zig')
-rw-r--r--src/Module.zig4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Module.zig b/src/Module.zig
index 13181ae326..58a5a50698 100644
--- a/src/Module.zig
+++ b/src/Module.zig
@@ -876,10 +876,12 @@ pub const EnumSimple = struct {
/// The Decl that corresponds to the enum itself.
owner_decl: *Decl,
/// Set of field names in declaration order.
- fields: std.StringArrayHashMapUnmanaged(void),
+ fields: NameMap,
/// Offset from `owner_decl`, points to the enum decl AST node.
node_offset: i32,
+ pub const NameMap = EnumFull.NameMap;
+
pub fn srcLoc(self: EnumSimple) SrcLoc {
return .{
.file_scope = self.owner_decl.getFileScope(),