aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-02-08 13:45:18 +0000
committergingerBill <bill@gingerbill.org>2024-02-08 13:45:18 +0000
commitdc5cfacc0af6f0d155124f6aefd960e83d54ff23 (patch)
tree2a4eb02015c1e90d1d680d98f1d9cd0ddc94cfbf /src
parent3aea2e1fff4c60759665fe5da28a6fba593943c8 (diff)
Fix edge case for procedures
Diffstat (limited to 'src')
-rw-r--r--src/check_type.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp
index 15bba5319..856e31cee 100644
--- a/src/check_type.cpp
+++ b/src/check_type.cpp
@@ -495,12 +495,12 @@ gb_internal Type *check_record_polymorphic_params(CheckerContext *ctx, Ast *poly
type = t_invalid;
}
- // if (is_type_polymorphic_type) {
- // gbString str = type_to_string(type);
- // error(params[i], "Parameter types cannot be polymorphic, got %s", str);
- // gb_string_free(str);
- // type = t_invalid;
- // }
+ if (is_type_polymorphic_type && !is_type_proc(type)) {
+ gbString str = type_to_string(type);
+ error(params[i], "Parameter types cannot be polymorphic, got %s", str);
+ gb_string_free(str);
+ type = t_invalid;
+ }
if (!is_type_param && check_constant_parameter_value(type, params[i])) {
// failed