diff options
| author | gingerBill <bill@gingerbill.org> | 2021-10-21 01:34:39 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-10-21 01:34:39 +0100 |
| commit | 48d277a3c4604481074df2914efbaba9e0dbed25 (patch) | |
| tree | 6ff9cb7c65046197e043f8b83fdbd2c872dce170 /src/check_expr.cpp | |
| parent | e0b9475378f4d69ebaf3e141ed941674b2c0d3f3 (diff) | |
Allow conversions between matrices of the same element count
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index ad12e00c8..ee7493553 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -2469,7 +2469,9 @@ bool check_is_castable_to(CheckerContext *c, Operand *operand, Type *y) { } if (src->Matrix.row_count != src->Matrix.column_count) { - return false; + i64 src_count = src->Matrix.row_count*src->Matrix.column_count; + i64 dst_count = dst->Matrix.row_count*dst->Matrix.column_count; + return src_count == dst_count; } if (dst->Matrix.row_count != dst->Matrix.column_count) { |