From 346aa5f71ca4e3d6a71187024f809eaf2fc6da1b Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Sat, 11 Feb 2017 15:50:24 +0000 Subject: Only check files that have been truly imported. --- src/types.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/types.c') 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++) { -- cgit v1.2.3