diff options
| author | gingerBill <bill@gingerbill.org> | 2024-01-28 23:49:59 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2024-01-28 23:49:59 +0000 |
| commit | a78f062499c7f0112558872a500904e6fbc6761b (patch) | |
| tree | 5e47fafef606ae8d8b9da2c29b35ae3df69898a2 | |
| parent | ddcaa0de5395bfb1a2b004e6a6cb5e2ba1e2eed1 (diff) | |
Fix semantics for casting between polymorphic specialized procedures
| -rw-r--r-- | src/check_expr.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index f8c5540f4..4f47ba523 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -2988,7 +2988,11 @@ 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)) { + if (is_type_polymorphic(dst)) { + if (is_type_polymorphic(src) && + operand->mode == Addressing_Variable) { + return true; + } return false; } return true; |