From 4d80f8598db5541ae9466799feaaa909398d53b4 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Mon, 31 May 2021 20:33:14 +0100 Subject: Fix polymorphic record "too few" lacking error message --- src/check_type.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/check_type.cpp') 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 -- cgit v1.2.3