mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-07 16:18:52 +00:00
Fix #2016 when passing an untyped integer to a generic typeid parameter
This commit is contained in:
+7
-1
@@ -6413,7 +6413,9 @@ CallArgumentError check_polymorphic_record_type(CheckerContext *c, Operand *oper
|
|||||||
if (e->kind == Entity_TypeName) {
|
if (e->kind == Entity_TypeName) {
|
||||||
if (o->mode != Addressing_Type) {
|
if (o->mode != Addressing_Type) {
|
||||||
if (show_error) {
|
if (show_error) {
|
||||||
error(o->expr, "Expected a type for the argument '%.*s'", LIT(e->token.string));
|
gbString expr = expr_to_string(o->expr);
|
||||||
|
error(o->expr, "Expected a type for the argument '%.*s', got %s", LIT(e->token.string), expr);
|
||||||
|
gb_string_free(expr);
|
||||||
}
|
}
|
||||||
err = CallArgumentError_WrongTypes;
|
err = CallArgumentError_WrongTypes;
|
||||||
}
|
}
|
||||||
@@ -6456,6 +6458,10 @@ CallArgumentError check_polymorphic_record_type(CheckerContext *c, Operand *oper
|
|||||||
// add_type_info_type(c, o->type);
|
// add_type_info_type(c, o->type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (show_error && err) {
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
bool failure = false;
|
bool failure = false;
|
||||||
Entity *found_entity = find_polymorphic_record_entity(c, original_type, param_count, ordered_operands, &failure);
|
Entity *found_entity = find_polymorphic_record_entity(c, original_type, param_count, ordered_operands, &failure);
|
||||||
|
|||||||
Reference in New Issue
Block a user