Patch issue with minimum dependency system and how it interacts with para poly procedures

This commit is contained in:
gingerBill
2021-02-26 15:09:32 +00:00
parent ac155d9036
commit 575c7ff031
5 changed files with 129 additions and 17 deletions
+19
View File
@@ -1674,6 +1674,25 @@ Type *check_get_params(CheckerContext *ctx, Scope *scope, Ast *_params, bool *is
}
}
}
if (type != t_invalid && !check_is_assignable_to(ctx, &op, type)) {
bool ok = true;
if (p->flags&FieldFlag_auto_cast) {
if (!check_is_castable_to(ctx, &op, type)) {
ok = false;
}
}
if (!ok) {
if (false) {
gbString got = type_to_string(op.type);
gbString expected = type_to_string(type);
error(op.expr, "Cannot assigned type to parameter, got type '%s', expected '%s'", got, expected);
gb_string_free(expected);
gb_string_free(got);
}
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);