aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/check_type.cpp')
-rw-r--r--src/check_type.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp
index f9f45361e..bd3271dcf 100644
--- a/src/check_type.cpp
+++ b/src/check_type.cpp
@@ -1554,6 +1554,13 @@ Type *check_get_params(CheckerContext *ctx, Scope *scope, Ast *_params, bool *is
success = false;
type = t_invalid;
}
+ if (is_type_untyped(default_type(type))) {
+ gbString str = type_to_string(type);
+ error(o.expr, "Cannot determine type from the parameter, got '%s'", str);
+ gb_string_free(str);
+ success = false;
+ type = t_invalid;
+ }
bool modify_type = !ctx->no_polymorphic_errors;
if (specialization != nullptr && !check_type_specialization_to(ctx, specialization, type, false, modify_type)) {
@@ -1604,6 +1611,13 @@ Type *check_get_params(CheckerContext *ctx, Scope *scope, Ast *_params, bool *is
success = false;
}
}
+ if (is_type_untyped(default_type(type))) {
+ gbString str = type_to_string(type);
+ error(op.expr, "Cannot determine type from the parameter, got '%s'", str);
+ gb_string_free(str);
+ success = false;
+ type = t_invalid;
+ }
}
if (p->flags&FieldFlag_no_alias) {