mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-09 13:01:38 -07:00
Add concrete type information for untyped values as procedure arguments
This commit is contained in:
@@ -4282,6 +4282,8 @@ CALL_ARGUMENT_CHECKER(check_call_arguments_internal) {
|
||||
err = CallArgumentError_WrongTypes;
|
||||
}
|
||||
}
|
||||
} else if (show_error) {
|
||||
check_assignment(c, &o, t, str_lit("argument"));
|
||||
}
|
||||
score += s;
|
||||
|
||||
@@ -4335,6 +4337,8 @@ CALL_ARGUMENT_CHECKER(check_call_arguments_internal) {
|
||||
check_assignment(c, &o, t, str_lit("argument"));
|
||||
}
|
||||
err = CallArgumentError_WrongTypes;
|
||||
} else if (show_error) {
|
||||
check_assignment(c, &o, t, str_lit("argument"));
|
||||
}
|
||||
score += s;
|
||||
if (is_type_any(elem)) {
|
||||
@@ -4557,6 +4561,8 @@ CALL_ARGUMENT_CHECKER(check_named_call_arguments) {
|
||||
err = CallArgumentError_NoneConstantParameter;
|
||||
}
|
||||
}
|
||||
} else if (show_error) {
|
||||
check_assignment(c, o, e->type, str_lit("procedure argument"));
|
||||
}
|
||||
score += s;
|
||||
}
|
||||
|
||||
@@ -11386,6 +11386,7 @@ lbValue lb_build_expr(lbProcedure *p, Ast *expr) {
|
||||
|
||||
if (tv.value.kind != ExactValue_Invalid) {
|
||||
// NOTE(bill): Short on constant values
|
||||
// GB_ASSERT_MSG(!is_type_untyped(tv.type), "%s @ %s", type_to_string(tv.type), token_pos_to_string(expr_pos));
|
||||
return lb_const_value(p->module, tv.type, tv.value);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user