diff options
| author | gingerBill <bill@gingerbill.org> | 2021-05-31 20:33:14 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-05-31 20:33:14 +0100 |
| commit | 4d80f8598db5541ae9466799feaaa909398d53b4 (patch) | |
| tree | 694b42f525311485946841cc95f61895f314139c /src/check_type.cpp | |
| parent | bc4591fc1e8a4ab1b6736b5a86c4ce55117d335a (diff) | |
Fix polymorphic record "too few" lacking error message
Diffstat (limited to 'src/check_type.cpp')
| -rw-r--r-- | src/check_type.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp index 419904876..0252bc989 100644 --- a/src/check_type.cpp +++ b/src/check_type.cpp @@ -250,9 +250,14 @@ Entity *find_polymorphic_record_entity(CheckerContext *ctx, Type *original_type, bool skip = false; + GB_ASSERT(ordered_operands.count >= param_count); + for (isize j = 0; j < param_count; j++) { Entity *p = tuple->variables[j]; Operand o = ordered_operands[j]; + if (o.expr == nullptr) { + return nullptr; + } Entity *oe = entity_of_node(o.expr); if (p == oe) { // NOTE(bill): This is the same type, make sure that it will be be same thing and use that |