auto_cast for named parameters
This commit is contained in:
1 parent
70586b1cf8
commit
708907df31
1 file changed
+11
-3
+11
-3
@@ -4101,10 +4101,18 @@ CALL_ARGUMENT_CHECKER(check_named_call_arguments) {
|
|||||||
} else {
|
} else {
|
||||||
i64 s = 0;
|
i64 s = 0;
|
||||||
if (!check_is_assignable_to_with_score(c, o, e->type, &s)) {
|
if (!check_is_assignable_to_with_score(c, o, e->type, &s)) {
|
||||||
if (show_error) {
|
bool ok = false;
|
||||||
check_assignment(c, o, e->type, str_lit("procedure argument"));
|
if (e->flags & EntityFlag_AutoCast) {
|
||||||
|
ok = check_is_castable_to(c, o, e->type);
|
||||||
|
}
|
||||||
|
if (ok) {
|
||||||
|
s = assign_score_function(10);
|
||||||
|
} else {
|
||||||
|
if (show_error) {
|
||||||
|
check_assignment(c, o, e->type, str_lit("procedure argument"));
|
||||||
|
}
|
||||||
|
err = CallArgumentError_WrongTypes;
|
||||||
}
|
}
|
||||||
err = CallArgumentError_WrongTypes;
|
|
||||||
}
|
}
|
||||||
score += s;
|
score += s;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user