aboutsummaryrefslogtreecommitdiff
path: root/types.c
diff options
context:
space:
mode:
Diffstat (limited to 'types.c')
-rw-r--r--types.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/types.c b/types.c
index cd388304..8cb534d7 100644
--- a/types.c
+++ b/types.c
@@ -594,6 +594,14 @@ type_t *get_field_type(type_t *t, const char *field_name)
}
return NULL;
}
+ case EnumType: {
+ auto e = Match(t, EnumType);
+ for (tag_t *tag = e->tags; tag; tag = tag->next) {
+ if (streq(field_name, tag->name))
+ return Type(BoolType);
+ }
+ return NULL;
+ }
case SetType: {
if (streq(field_name, "length"))
return INT_TYPE;