From e6b8f7e77a419c8ff9e5f7de23fe15bef63264b1 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Mon, 3 Jan 2022 12:54:31 +0000 Subject: [PATCH] Fix #1398 --- src/check_expr.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 67e2f3bd7..cfffffd9f 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -7688,6 +7688,14 @@ ExprKind check_expr_base_internal(CheckerContext *c, Operand *o, Ast *node, Type } } + if (t->kind == Type_Matrix) { + if (cl->elems.count > 0 && cl->elems[0]->kind != Ast_FieldValue) { + if (0 < max && max < max_type_count) { + error(node, "Expected %lld values for this matrix literal, got %lld", cast(long long)max_type_count, cast(long long)max); + } + } + } + break; }