mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-20 11:30:34 +00:00
Fix build error caused by invalid iterator types in for
This commit is contained in:
@@ -149,7 +149,7 @@ String get_filepath_extension(String path) {
|
||||
|
||||
void init_build_context(BuildContext *bc) {
|
||||
bc->ODIN_VENDOR = str_lit("odin");
|
||||
bc->ODIN_VERSION = str_lit("0.0.5a");
|
||||
bc->ODIN_VERSION = str_lit("0.0.5c");
|
||||
bc->ODIN_ROOT = odin_root_dir();
|
||||
|
||||
#if defined(GB_SYSTEM_WINDOWS)
|
||||
|
||||
@@ -654,7 +654,9 @@ void check_stmt_internal(Checker *c, AstNode *node, u32 flags) {
|
||||
|
||||
if (val == NULL) {
|
||||
gbString s = expr_to_string(operand.expr);
|
||||
error_node(node, "Cannot iterate over %s", s);
|
||||
gbString t = type_to_string(operand.type);
|
||||
error_node(operand.expr, "Cannot iterate over `%s` of type `%s`", s, t);
|
||||
gb_string_free(t);
|
||||
gb_string_free(s);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,6 +198,8 @@ void error_va(Token token, char *fmt, va_list va) {
|
||||
gb_printf_err("%.*s(%td:%td) %s\n",
|
||||
LIT(token.pos.file), token.pos.line, token.pos.column,
|
||||
gb_bprintf_va(fmt, va));
|
||||
} else if (token.pos.line == 0) {
|
||||
gb_printf_err("Error: %s\n", gb_bprintf_va(fmt, va));
|
||||
}
|
||||
|
||||
gb_mutex_unlock(&global_error_collector.mutex);
|
||||
@@ -212,6 +214,8 @@ void syntax_error_va(Token token, char *fmt, va_list va) {
|
||||
gb_printf_err("%.*s(%td:%td) Syntax Error: %s\n",
|
||||
LIT(token.pos.file), token.pos.line, token.pos.column,
|
||||
gb_bprintf_va(fmt, va));
|
||||
} else if (token.pos.line == 0) {
|
||||
gb_printf_err("Error: %s\n", gb_bprintf_va(fmt, va));
|
||||
}
|
||||
|
||||
gb_mutex_unlock(&global_error_collector.mutex);
|
||||
|
||||
Reference in New Issue
Block a user