Merge remote-tracking branch 'offical/master'

This commit is contained in:
2024-06-15 15:00:21 -04:00
38 changed files with 1432 additions and 1204 deletions
+4 -1
View File
@@ -2550,7 +2550,7 @@ gb_internal void check_unary_expr(CheckerContext *c, Operand *o, Token op, Ast *
error_line("\tSuggestion: Did you want to pass the iterable value to the for statement by pointer to get addressable semantics?\n");
}
if (is_type_map(parent_type)) {
if (parent_type != nullptr && is_type_map(parent_type)) {
error_line("\t Prefer doing 'for key, &%.*s in ...'\n", LIT(e->token.string));
} else {
error_line("\t Prefer doing 'for &%.*s in ...'\n", LIT(e->token.string));
@@ -3564,6 +3564,9 @@ gb_internal void check_binary_matrix(CheckerContext *c, Token const &op, Operand
x->mode = Addressing_Value;
if (are_types_identical(xt, yt)) {
if (are_types_identical(x->type, y->type)) {
return;
}
if (!is_type_named(x->type) && is_type_named(y->type)) {
// prefer the named type
x->type = y->type;
+2 -1
View File
@@ -2934,7 +2934,8 @@ int main(int arg_count, char const **arg_ptr) {
// TODO(jeroen): Remove the `init_filename` param.
// Let's put that on `build_context.build_paths[0]` instead.
if (parse_packages(parser, init_filename) != ParseFile_None) {
return 1;
GB_ASSERT_MSG(any_errors(), "parse_packages failed but no error was reported.");
// We depend on the next conditional block to return 1, after printing errors.
}
if (any_errors()) {