aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2025-04-09 13:33:06 +0100
committergingerBill <bill@gingerbill.org>2025-04-09 13:33:06 +0100
commit2548fc24310bd6cbcaa74c32c80d3bef69c838fb (patch)
treedb065dca1d8c9e7f1eb6e23b073503b20c016d5c
parenta15b36792118ffd4f69e04754cd5b7081c6eb296 (diff)
Actually maybe fix #5015
-rw-r--r--src/check_type.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp
index 4fa02fd5f..2fcd7ff24 100644
--- a/src/check_type.cpp
+++ b/src/check_type.cpp
@@ -3507,6 +3507,7 @@ gb_internal bool check_type_internal(CheckerContext *ctx, Ast *e, Type **type, T
if (!ctx->in_polymorphic_specialization && ctx->disallow_polymorphic_return_types) {
Type *t = base_type(elem);
if (t != nullptr &&
+ unparen_expr(pt->type)->kind == Ast_Ident &&
is_type_polymorphic_record_unspecialized(t)) {
gbString err_str = expr_to_string(e);
error(e, "Invalid use of a non-specialized polymorphic type '%s'", err_str);