aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-10-20 02:18:30 +0100
committergingerBill <bill@gingerbill.org>2021-10-20 02:18:30 +0100
commitcee45c1b155fcc917c2b0f9cfdbfa060304255e1 (patch)
treeadb7cf8841ca8523e14e3c276580b9905777059f /src/check_type.cpp
parent68afbb37f40b10fd01dda9e5640cc7ae2535a371 (diff)
Add `hadamard_product`
Diffstat (limited to 'src/check_type.cpp')
-rw-r--r--src/check_type.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp
index e752f192d..d9302c65a 100644
--- a/src/check_type.cpp
+++ b/src/check_type.cpp
@@ -997,8 +997,8 @@ void check_bit_set_type(CheckerContext *c, Type *type, Type *named_type, Ast *no
GB_ASSERT(lower <= upper);
- i64 bits = MAX_BITS;
- if (bs->underlying != nullptr) {
+ i64 bits = MAX_BITS
+; if (bs->underlying != nullptr) {
Type *u = check_type(c, bs->underlying);
if (!is_type_integer(u)) {
gbString ts = type_to_string(u);
@@ -2239,13 +2239,7 @@ void check_matrix_type(CheckerContext *ctx, Type **type, Ast *node) {
error(column.expr, "Matrix types are limited to a maximum of %d elements, got %lld", MAX_MATRIX_ELEMENT_COUNT, cast(long long)element_count);
}
- if (is_type_integer(elem)) {
- // okay
- } else if (is_type_float(elem)) {
- // okay
- } else if (is_type_complex(elem)) {
- // okay
- } else {
+ if (!is_type_valid_for_matrix_elems(elem)) {
gbString s = type_to_string(elem);
error(column.expr, "Matrix elements types are limited to integers, floats, and complex, got %s", s);
gb_string_free(s);