mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
auto_cast for named parameters
This commit is contained in:
+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