aboutsummaryrefslogtreecommitdiff
path: root/src/types.c
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-02-11 15:50:24 +0000
committerGinger Bill <bill@gingerbill.org>2017-02-11 15:50:24 +0000
commit346aa5f71ca4e3d6a71187024f809eaf2fc6da1b (patch)
treed61331a1bf713f66bcdba8816b8b01eef3e643b2 /src/types.c
parent73d6a55f5c96459d30eca5747d1458bcf6e9fec4 (diff)
Only check files that have been truly imported.
Diffstat (limited to 'src/types.c')
-rw-r--r--src/types.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/types.c b/src/types.c
index 71888a372..af8d4dd37 100644
--- a/src/types.c
+++ b/src/types.c
@@ -102,12 +102,12 @@ typedef struct TypeRecord {
Entity **fields_in_src_order; // Entity_Variable
i64 custom_align; // NOTE(bill): Only used in structs at the moment
+ Entity * names;
Type * enum_base_type;
Entity * enum_count;
Entity * enum_min_value;
Entity * enum_max_value;
- Entity * enum_names;
} TypeRecord;
#define TYPE_KINDS \
@@ -1318,6 +1318,14 @@ Selection lookup_field_with_selection(gbAllocator a, Type *type_, String field_n
return sel;
}
if (is_type) {
+ if (type->kind == Type_Record) {
+ if (type->Record.names != NULL &&
+ str_eq(field_name, str_lit("names"))) {
+ sel.entity = type->Record.names;
+ return sel;
+ }
+ }
+
if (is_type_union(type)) {
// NOTE(bill): The subtype for a union are stored in the fields
// as they are "kind of" like variables but not
@@ -1347,10 +1355,6 @@ Selection lookup_field_with_selection(gbAllocator a, Type *type_, String field_n
sel.entity = type->Record.enum_max_value;
return sel;
}
- if (str_eq(field_name, str_lit("names"))) {
- sel.entity = type->Record.enum_names;
- return sel;
- }
}
for (isize i = 0; i < type->Record.field_count; i++) {