mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-14 01:42:22 -07:00
Fix parapoly related bugs #370
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user