aboutsummaryrefslogtreecommitdiff
path: root/src/types.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/types.c')
-rw-r--r--src/types.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/types.c b/src/types.c
index b34d8bf9..e3bf326c 100644
--- a/src/types.c
+++ b/src/types.c
@@ -701,8 +701,7 @@ type_t *get_field_type(type_t *t, const char *field_name) {
DeclareMatch(e, t, EnumType);
for (tag_t *tag = e->tags; tag; tag = tag->next) {
if (!streq(field_name, tag->name)) continue;
- if (tag->type != NULL && Match(tag->type, StructType)->fields) return Type(OptionalType, tag->type);
- else return Type(OptionalType, EMPTY_TYPE);
+ return Type(OptionalType, tag->type);
}
return NULL;
}
@@ -835,10 +834,3 @@ type_t *_make_function_type(type_t *ret, int n, arg_t args[n]) {
}
return Type(FunctionType, .ret = ret, .args = &arg_pointers[0]);
}
-
-PUREFUNC bool enum_has_fields(type_t *t) {
- for (tag_t *e_tag = Match(t, EnumType)->tags; e_tag; e_tag = e_tag->next) {
- if (e_tag->type != NULL && Match(e_tag->type, StructType)->fields) return true;
- }
- return false;
-}