diff options
| author | gingerBill <bill@gingerbill.org> | 2021-10-21 01:14:44 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-10-21 01:14:44 +0100 |
| commit | e0b9475378f4d69ebaf3e141ed941674b2c0d3f3 (patch) | |
| tree | 15147d229ca88cd43a62051129e3804a374bded0 /src/check_type.cpp | |
| parent | c561de33eec802578b2f56b303b0909a346e897c (diff) | |
Allow casting between square matrices of the same element type
Diffstat (limited to 'src/check_type.cpp')
| -rw-r--r-- | src/check_type.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp index d9302c65a..21c8a9f19 100644 --- a/src/check_type.cpp +++ b/src/check_type.cpp @@ -1154,7 +1154,11 @@ Type *determine_type_from_polymorphic(CheckerContext *ctx, Type *poly_type, Oper bool show_error = modify_type && !ctx->hide_polymorphic_errors; if (!is_operand_value(operand)) { if (show_error) { - error(operand.expr, "Cannot determine polymorphic type from parameter"); + gbString pts = type_to_string(poly_type); + gbString ots = type_to_string(operand.type); + defer (gb_string_free(pts)); + defer (gb_string_free(ots)); + error(operand.expr, "Cannot determine polymorphic type from parameter: '%s' to '%s'", ots, pts); } return t_invalid; } @@ -2839,10 +2843,6 @@ bool check_type_internal(CheckerContext *ctx, Ast *e, Type **type, Type *named_t case_ast_node(mt, MatrixType, e); - bool ips = ctx->in_polymorphic_specialization; - defer (ctx->in_polymorphic_specialization = ips); - ctx->in_polymorphic_specialization = false; - check_matrix_type(ctx, type, e); set_base_type(named_type, *type); return true; |