stage2: implement @hasField

struct and union are kept in stage1 because struct/unionFieldCount are returning zero
This commit is contained in:
Meghan Denny authored and Andrew Kelley committed 2021-10-17 21:42:22 -07:00
1 parent 7d0a74456b
commit 0ef2e2520a
6 files changed
+57 -87

No files matched your search

+3 -1
View File
@@ -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(),