diff options
| author | gingerBill <bill@gingerbill.org> | 2024-01-26 12:56:16 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2024-01-26 12:56:16 +0000 |
| commit | 15b40a4f292ec0fbb71d2a16a0f8b3cd52f41a9e (patch) | |
| tree | 704ecb3b3441827c2cd423ee150bba67ae556305 /src/check_expr.cpp | |
| parent | 5406acc8fa9aded68e47b25c3464cb7eee713c8c (diff) | |
Fix #3122
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 bc7ff1bbb..f8c5540f4 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -2988,6 +2988,9 @@ gb_internal bool check_is_castable_to(CheckerContext *c, Operand *operand, Type } // proc <-> proc if (is_type_proc(src) && is_type_proc(dst)) { + if (is_type_polymorphic(src) || is_type_polymorphic(dst)) { + return false; + } return true; } @@ -3067,7 +3070,6 @@ gb_internal void check_cast(CheckerContext *c, Operand *x, Type *type) { bool is_const_expr = x->mode == Addressing_Constant; bool can_convert = check_cast_internal(c, x, type); - if (!can_convert) { TEMPORARY_ALLOCATOR_GUARD(); gbString expr_str = expr_to_string(x->expr, temporary_allocator()); |