diff options
| author | gingerBill <bill@gingerbill.org> | 2018-03-23 16:35:41 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2018-03-23 16:35:41 +0000 |
| commit | 2e1e1e6034152fa83a05b7fb47e75eefe758ca62 (patch) | |
| tree | e178a798c89f9a0ef012dee31a64da8a3827c232 /src/check_expr.cpp | |
| parent | 991479fbf921ab04b921bbb8163e5522f78feb3c (diff) | |
Type caching
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index d5c39690e..4996d7853 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -782,21 +782,21 @@ bool is_polymorphic_type_assignable(Checker *c, Type *poly, Type *source, bool c if (source->kind == Type_Array) { // IMPORTANT TODO(bill): Which is correct? - // if (poly->Array.generic_type != nullptr && modify_type) { - if (poly->Array.generic_type != nullptr) { - Type *gt = poly->Array.generic_type; + // if (poly->Array.generic_count != nullptr && modify_type) { + if (poly->Array.generic_count != nullptr) { + Type *gt = poly->Array.generic_count; GB_ASSERT(gt->kind == Type_Generic); Entity *e = scope_lookup_entity(gt->Generic.scope, gt->Generic.name); GB_ASSERT(e != nullptr); if (e->kind == Entity_TypeName) { - poly->Array.generic_type = nullptr; + poly->Array.generic_count = nullptr; poly->Array.count = source->Array.count; e->kind = Entity_Constant; e->Constant.value = exact_value_i64(source->Array.count); e->type = t_untyped_integer; } else if (e->kind == Entity_Constant) { - poly->Array.generic_type = nullptr; + poly->Array.generic_count = nullptr; if (e->Constant.value.kind != ExactValue_Integer) { return false; } |