aboutsummaryrefslogtreecommitdiff
path: root/src/check_stmt.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-05-18 11:52:16 +0100
committergingerBill <bill@gingerbill.org>2023-05-18 11:52:16 +0100
commit56c0d32ea0c81ad9913e4e512952b3be25688504 (patch)
treefee942c4699ad9da4cc96bbc5d0a27c46e5f710f /src/check_stmt.cpp
parentc0e84b05923cef2d3fb1d6c0ef5b9e9a119363fe (diff)
Fix #2526
Diffstat (limited to 'src/check_stmt.cpp')
-rw-r--r--src/check_stmt.cpp6
1 files changed, 6 insertions, 0 deletions
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;