Browse Source

Improve matrix type hinting rules a little

gingerBill 1 year ago
parent
commit
f57c03c170
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/check_expr.cpp

+ 2 - 0
src/check_expr.cpp

@@ -3568,6 +3568,8 @@ gb_internal void check_binary_matrix(CheckerContext *c, Token const &op, Operand
 						// prefer the named type
 						// prefer the named type
 						x->type = y->type;
 						x->type = y->type;
 					}
 					}
+					// finish
+					return;
 				} else {
 				} else {
 					bool is_row_major = xt->Matrix.is_row_major && yt->Matrix.is_row_major;
 					bool is_row_major = xt->Matrix.is_row_major && yt->Matrix.is_row_major;
 					x->type = alloc_type_matrix(xt->Matrix.elem, xt->Matrix.row_count, yt->Matrix.column_count, nullptr, nullptr, is_row_major);
 					x->type = alloc_type_matrix(xt->Matrix.elem, xt->Matrix.row_count, yt->Matrix.column_count, nullptr, nullptr, is_row_major);