mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Improve error message for missing & in some parapoly messages
This commit is contained in:
@@ -1611,6 +1611,12 @@ gb_internal Type *determine_type_from_polymorphic(CheckerContext *ctx, Type *pol
|
|||||||
error_line("\tSuggestion: Try slicing the value with '%s[:]'\n", os);
|
error_line("\tSuggestion: Try slicing the value with '%s[:]'\n", os);
|
||||||
gb_string_free(os);
|
gb_string_free(os);
|
||||||
}
|
}
|
||||||
|
} else if (is_type_pointer(poly_type)) {
|
||||||
|
if (is_polymorphic_type_assignable(ctx, type_deref(poly_type), operand.type, /*compound*/false, /*modify_type*/false)) {
|
||||||
|
gbString os = expr_to_string(operand.expr);
|
||||||
|
error_line("\tSuggestion: Did you mean '&%s'?\n", os);
|
||||||
|
gb_string_free(os);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return t_invalid;
|
return t_invalid;
|
||||||
|
|||||||
Reference in New Issue
Block a user