From 56c0d32ea0c81ad9913e4e512952b3be25688504 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Thu, 18 May 2023 11:52:16 +0100 Subject: Fix #2526 --- src/check_stmt.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/check_stmt.cpp') diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp index 388a64e00..1e3b35c21 100644 --- a/src/check_stmt.cpp +++ b/src/check_stmt.cpp @@ -402,6 +402,12 @@ gb_internal Type *check_assignment_variable(CheckerContext *ctx, Operand *lhs, O Type *assignment_type = lhs->type; + if (rhs->mode == Addressing_Type && is_type_polymorphic(rhs->type)) { + gbString t = type_to_string(rhs->type); + error(rhs->expr, "Invalid use of a non-specialized polymorphic type '%s'", t); + gb_string_free(t); + } + switch (lhs->mode) { case Addressing_Invalid: return nullptr; -- cgit v1.2.3