aboutsummaryrefslogtreecommitdiff
path: root/src/check_decl.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-05-09 10:58:57 +0100
committergingerBill <bill@gingerbill.org>2024-05-09 10:58:57 +0100
commitd85c8f0b2c5989f7d14b02c9023060990d241111 (patch)
treeacbd8ff0cc3f6d18d741a309e03aacdca8c08deb /src/check_decl.cpp
parent97e9c50d116024901ce029c495495fd723cedf7f (diff)
Fix #3555
Diffstat (limited to 'src/check_decl.cpp')
-rw-r--r--src/check_decl.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp
index 5b9486873..441c8000d 100644
--- a/src/check_decl.cpp
+++ b/src/check_decl.cpp
@@ -1619,6 +1619,17 @@ gb_internal bool check_proc_body(CheckerContext *ctx_, Token token, DeclInfo *de
if (e->kind != Entity_Variable) {
continue;
}
+ if (is_type_polymorphic(e->type)) {
+ gbString s = type_to_string(e->type);
+ char const *msg = "Unspecialized polymorphic types are not allowed in procedure parameters, got %s";
+ if (e->Variable.type_expr) {
+ error(e->Variable.type_expr, msg, s);
+ } else {
+ error(e->token, msg, s);
+ }
+ gb_string_free(s);
+ }
+
if (!(e->flags & EntityFlag_Using)) {
continue;
}