[v:master] 9a0f49950 - ci: Added PKGBUILD & workflow for deploying Arch packages

main
vbot 2022-05-17 10:38:10 +00:00
parent 1b59268194
commit 5534f78749
2 changed files with 220 additions and 152 deletions

192
v.c
View File

@ -1,11 +1,11 @@
#define V_COMMIT_HASH "12ec3b9d5" #define V_COMMIT_HASH "9a0f49950"
#ifndef V_COMMIT_HASH #ifndef V_COMMIT_HASH
#define V_COMMIT_HASH "b10cf3e0f" #define V_COMMIT_HASH "12ec3b9d5"
#endif #endif
#ifndef V_CURRENT_COMMIT_HASH #ifndef V_CURRENT_COMMIT_HASH
#define V_CURRENT_COMMIT_HASH "12ec3b9" #define V_CURRENT_COMMIT_HASH "9a0f499"
#endif #endif
// V comptime_definitions: // V comptime_definitions:
@ -38182,7 +38182,7 @@ void v__pref__Preferences_fill_with_defaults(v__pref__Preferences* p) {
} }
#endif #endif
} }
string vhash = _SLIT("b10cf3e0f"); string vhash = _SLIT("12ec3b9d5");
p->cache_manager = v__vcache__new_cache_manager(new_array_from_c_array(7, 7, sizeof(string), _MOV((string[7]){string_clone(vhash), str_intp(6, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.pref.Backend*/0xfe10, {.d_s = v__pref__Backend_str(p->backend)}}, {_SLIT(" | "), /*115 &v.pref.OS*/0xfe10, {.d_s = v__pref__OS_str(p->os)}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = p->ccompiler}}, {_SLIT(" | "), /*115 &bool*/0xfe10, {.d_s = p->is_prod ? _SLIT("true") : _SLIT("false")}}, {_SLIT(" | "), /*115 &bool*/0xfe10, {.d_s = p->sanitize ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}})), string_clone(string_trim_space(p->cflags)), string_clone(string_trim_space(p->third_party_option)), string_clone(Array_string_str(p->compile_defines_all)), string_clone(Array_string_str(p->compile_defines)), string_clone(Array_string_str(p->lookup_path))}))); p->cache_manager = v__vcache__new_cache_manager(new_array_from_c_array(7, 7, sizeof(string), _MOV((string[7]){string_clone(vhash), str_intp(6, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.pref.Backend*/0xfe10, {.d_s = v__pref__Backend_str(p->backend)}}, {_SLIT(" | "), /*115 &v.pref.OS*/0xfe10, {.d_s = v__pref__OS_str(p->os)}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = p->ccompiler}}, {_SLIT(" | "), /*115 &bool*/0xfe10, {.d_s = p->is_prod ? _SLIT("true") : _SLIT("false")}}, {_SLIT(" | "), /*115 &bool*/0xfe10, {.d_s = p->sanitize ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}})), string_clone(string_trim_space(p->cflags)), string_clone(string_trim_space(p->third_party_option)), string_clone(Array_string_str(p->compile_defines_all)), string_clone(Array_string_str(p->compile_defines)), string_clone(Array_string_str(p->lookup_path))})));
if (string__eq(os__user_os(), _SLIT("windows"))) { if (string__eq(os__user_os(), _SLIT("windows"))) {
p->use_cache = false; p->use_cache = false;
@ -40904,7 +40904,7 @@ string v__util__formatted_error(string kind, string omsg, string filepath, v__to
path = string_replace_once(path, _const_v__util__normalised_workdir, _SLIT("")); path = string_replace_once(path, _const_v__util__normalised_workdir, _SLIT(""));
} }
} }
string position = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT(":"), /*100 &int*/0xfe07, {.d_i32 = pos.line_nr + 1}}, {_SLIT(":"), /*100 &int*/0xfe07, {.d_i32 = v__mathutil__max_T_int(1, pos.col + 1)}}, {_SLIT(":"), 0, { .d_c = 0 }}})); string position = (filepath.len > 0 ? ( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT(":"), /*100 &int*/0xfe07, {.d_i32 = pos.line_nr + 1}}, {_SLIT(":"), /*100 &int*/0xfe07, {.d_i32 = v__mathutil__max_T_int(1, pos.col + 1)}}, {_SLIT(":"), 0, { .d_c = 0 }}}))) : (_SLIT("")));
string scontext = Array_string_join(v__util__source_file_context(kind, filepath, pos), _SLIT("\n")); string scontext = Array_string_join(v__util__source_file_context(kind, filepath, pos), _SLIT("\n"));
string final_position = v__util__bold(position); string final_position = v__util__bold(position);
string final_kind = v__util__bold(v__util__color(kind, kind)); string final_kind = v__util__bold(v__util__color(kind, kind));
@ -50702,117 +50702,128 @@ bool v__checker__Checker_check_types(v__checker__Checker* c, v__ast__Type got, v
} }
v__ast__TypeSymbol* got_sym = v__ast__Table_sym(c->table, got); v__ast__TypeSymbol* got_sym = v__ast__Table_sym(c->table, got);
v__ast__TypeSymbol* expected_sym = v__ast__Table_sym(c->table, expected); v__ast__TypeSymbol* expected_sym = v__ast__Table_sym(c->table, expected);
if (got_sym->kind == v__ast__Kind__enum_) { if (got_sym->kind == v__ast__Kind__array && expected_sym->kind == v__ast__Kind__array) {
if (v__ast__TypeSymbol_is_number(expected_sym)) { if (v__ast__Type_is_any_kind_of_pointer((/* as */ *(v__ast__Array*)__as_cast((got_sym->info)._v__ast__Array,(got_sym->info)._typ, 413) /*expected idx: 413, name: v.ast.Array */ ).elem_type) && v__ast__Type_is_any_kind_of_pointer((/* as */ *(v__ast__Array*)__as_cast((expected_sym->info)._v__ast__Array,(expected_sym->info)._typ, 413) /*expected idx: 413, name: v.ast.Array */ ).elem_type)) {
bool _t8 = true; bool _t8 = true;
return _t8; return _t8;
} }
} else if (got_sym->kind == v__ast__Kind__array_fixed) { } else if (got_sym->kind == v__ast__Kind__array_fixed && expected_sym->kind == v__ast__Kind__array_fixed) {
if (v__ast__TypeSymbol_is_number(expected_sym) || v__ast__Type_is_any_kind_of_pointer(expected)) { if (v__ast__Type_is_any_kind_of_pointer((/* as */ *(v__ast__ArrayFixed*)__as_cast((got_sym->info)._v__ast__ArrayFixed,(got_sym->info)._typ, 441) /*expected idx: 441, name: v.ast.ArrayFixed */ ).elem_type) && v__ast__Type_is_any_kind_of_pointer((/* as */ *(v__ast__ArrayFixed*)__as_cast((expected_sym->info)._v__ast__ArrayFixed,(expected_sym->info)._typ, 441) /*expected idx: 441, name: v.ast.ArrayFixed */ ).elem_type)) {
bool _t9 = true; bool _t9 = true;
return _t9; return _t9;
} }
} else if (expected_sym->kind == v__ast__Kind__array_fixed) { }
if (v__ast__TypeSymbol_is_number(got_sym) && v__ast__Type_is_any_kind_of_pointer(got)) { if (got_sym->kind == v__ast__Kind__enum_) {
if (v__ast__TypeSymbol_is_number(expected_sym)) {
bool _t10 = true; bool _t10 = true;
return _t10; return _t10;
}
} else if (got_sym->kind == v__ast__Kind__array_fixed) {
if (v__ast__TypeSymbol_is_number(expected_sym) || v__ast__Type_is_any_kind_of_pointer(expected)) {
bool _t11 = true;
return _t11;
}
} else if (expected_sym->kind == v__ast__Kind__array_fixed) {
if (v__ast__TypeSymbol_is_number(got_sym) && v__ast__Type_is_any_kind_of_pointer(got)) {
bool _t12 = true;
return _t12;
} else if (got_sym->kind == v__ast__Kind__array) { } else if (got_sym->kind == v__ast__Kind__array) {
v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((expected_sym->info)._v__ast__ArrayFixed,(expected_sym->info)._typ, 441) /*expected idx: 441, name: v.ast.ArrayFixed */ ; v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((expected_sym->info)._v__ast__ArrayFixed,(expected_sym->info)._typ, 441) /*expected idx: 441, name: v.ast.ArrayFixed */ ;
v__ast__Array info2 = /* as */ *(v__ast__Array*)__as_cast((got_sym->info)._v__ast__Array,(got_sym->info)._typ, 413) /*expected idx: 413, name: v.ast.Array */ ; v__ast__Array info2 = /* as */ *(v__ast__Array*)__as_cast((got_sym->info)._v__ast__Array,(got_sym->info)._typ, 413) /*expected idx: 413, name: v.ast.Array */ ;
if (v__checker__Checker_check_types(c, info.elem_type, info2.elem_type)) { if (v__checker__Checker_check_types(c, info.elem_type, info2.elem_type)) {
bool _t11 = true;
return _t11;
}
}
} else if (got_sym->kind == v__ast__Kind__array) {
if (v__ast__TypeSymbol_is_number(expected_sym) || v__ast__Type_is_any_kind_of_pointer(expected)) {
bool _t12 = true;
return _t12;
}
} else if (expected_sym->kind == v__ast__Kind__array) {
if (v__ast__TypeSymbol_is_number(got_sym) && v__ast__Type_is_any_kind_of_pointer(got)) {
bool _t13 = true; bool _t13 = true;
return _t13; return _t13;
} }
} }
if (expected_sym->kind == v__ast__Kind__enum_ && v__ast__TypeSymbol_is_number(got_sym)) { } else if (got_sym->kind == v__ast__Kind__array) {
if (v__ast__TypeSymbol_is_number(expected_sym) || v__ast__Type_is_any_kind_of_pointer(expected)) {
bool _t14 = true; bool _t14 = true;
return _t14; return _t14;
} }
if (got_is_ptr && exp_is_ptr) { } else if (expected_sym->kind == v__ast__Kind__array) {
if (v__ast__TypeSymbol_is_number(expected_sym) && v__ast__TypeSymbol_is_number(got_sym)) { if (v__ast__TypeSymbol_is_number(got_sym) && v__ast__Type_is_any_kind_of_pointer(got)) {
bool _t15 = true; bool _t15 = true;
return _t15; return _t15;
} }
} }
if (expected_sym->kind == v__ast__Kind__enum_ && v__ast__TypeSymbol_is_number(got_sym)) {
bool _t16 = true;
return _t16;
}
if (got_is_ptr && exp_is_ptr) {
if (v__ast__TypeSymbol_is_number(expected_sym) && v__ast__TypeSymbol_is_number(got_sym)) {
bool _t17 = true;
return _t17;
}
}
} }
if (got_is_ptr && exp_is_ptr) { if (got_is_ptr && exp_is_ptr) {
if (v__ast__Type_nr_muls(got) != v__ast__Type_nr_muls(expected)) { if (v__ast__Type_nr_muls(got) != v__ast__Type_nr_muls(expected)) {
bool _t16 = false; bool _t18 = false;
return _t16; return _t18;
} }
} }
int exp_idx = v__ast__Type_idx(expected); int exp_idx = v__ast__Type_idx(expected);
int got_idx = v__ast__Type_idx(got); int got_idx = v__ast__Type_idx(got);
if (exp_idx == got_idx) { if (exp_idx == got_idx) {
bool _t17 = true;
return _t17;
}
if (exp_idx == _const_v__ast__voidptr_type_idx || exp_idx == _const_v__ast__byteptr_type_idx || (v__ast__Type_is_ptr(expected) && v__ast__Type_idx(v__ast__Type_deref(expected)) == _const_v__ast__byte_type_idx)) {
if (v__ast__Type_is_ptr(got) || v__ast__Type_is_pointer(got)) {
bool _t18 = true;
return _t18;
}
}
if (v__ast__Type_is_real_pointer(expected)) {
if (v__ast__Type_alias_eq(got, _const_v__ast__int_literal_type)) {
bool _t19 = true; bool _t19 = true;
return _t19; return _t19;
} }
} if (exp_idx == _const_v__ast__voidptr_type_idx || exp_idx == _const_v__ast__byteptr_type_idx || (v__ast__Type_is_ptr(expected) && v__ast__Type_idx(v__ast__Type_deref(expected)) == _const_v__ast__byte_type_idx)) {
if (got_idx == _const_v__ast__voidptr_type_idx || got_idx == _const_v__ast__byteptr_type_idx || (got_idx == _const_v__ast__byte_type_idx && v__ast__Type_is_ptr(got))) { if (v__ast__Type_is_ptr(got) || v__ast__Type_is_pointer(got)) {
if (v__ast__Type_is_ptr(expected) || v__ast__Type_is_pointer(expected)) {
bool _t20 = true; bool _t20 = true;
return _t20; return _t20;
} }
} }
if (v__ast__Type_alias_eq(expected, _const_v__ast__charptr_type) && v__ast__Type_alias_eq(got, v__ast__Type_ref(_const_v__ast__char_type))) { if (v__ast__Type_is_real_pointer(expected)) {
if (v__ast__Type_alias_eq(got, _const_v__ast__int_literal_type)) {
bool _t21 = true; bool _t21 = true;
return _t21; return _t21;
} }
}
if (got_idx == _const_v__ast__voidptr_type_idx || got_idx == _const_v__ast__byteptr_type_idx || (got_idx == _const_v__ast__byte_type_idx && v__ast__Type_is_ptr(got))) {
if (v__ast__Type_is_ptr(expected) || v__ast__Type_is_pointer(expected)) {
bool _t22 = true;
return _t22;
}
}
if (v__ast__Type_alias_eq(expected, _const_v__ast__charptr_type) && v__ast__Type_alias_eq(got, v__ast__Type_ref(_const_v__ast__char_type))) {
bool _t23 = true;
return _t23;
}
if (v__ast__Type_has_flag(expected, v__ast__TypeFlag__optional) || v__ast__Type_has_flag(expected, v__ast__TypeFlag__result)) { if (v__ast__Type_has_flag(expected, v__ast__TypeFlag__optional) || v__ast__Type_has_flag(expected, v__ast__TypeFlag__result)) {
v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, got); v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, got);
if (((sym->idx == _const_v__ast__error_type_idx || (v__ast__Type_alias_eq(got, _const_v__ast__none_type) || v__ast__Type_alias_eq(got, _const_v__ast__error_type))) && v__ast__Type_has_flag(expected, v__ast__TypeFlag__optional)) || ((sym->idx == _const_v__ast__error_type_idx || v__ast__Type_alias_eq(got, _const_v__ast__error_type)) && v__ast__Type_has_flag(expected, v__ast__TypeFlag__result))) { if (((sym->idx == _const_v__ast__error_type_idx || (v__ast__Type_alias_eq(got, _const_v__ast__none_type) || v__ast__Type_alias_eq(got, _const_v__ast__error_type))) && v__ast__Type_has_flag(expected, v__ast__TypeFlag__optional)) || ((sym->idx == _const_v__ast__error_type_idx || v__ast__Type_alias_eq(got, _const_v__ast__error_type)) && v__ast__Type_has_flag(expected, v__ast__TypeFlag__result))) {
bool _t22 = true; bool _t24 = true;
return _t22; return _t24;
} else if (!v__checker__Checker_check_basic(c, got, v__ast__Type_clear_flag(v__ast__Type_clear_flag(expected, v__ast__TypeFlag__optional), v__ast__TypeFlag__result))) { } else if (!v__checker__Checker_check_basic(c, got, v__ast__Type_clear_flag(v__ast__Type_clear_flag(expected, v__ast__TypeFlag__optional), v__ast__TypeFlag__result))) {
bool _t23 = false; bool _t25 = false;
return _t23; return _t25;
} }
} }
if (!v__checker__Checker_check_basic(c, got, expected)) { if (!v__checker__Checker_check_basic(c, got, expected)) {
bool _t24 = false; bool _t26 = false;
return _t24; return _t26;
} }
if (v__ast__Type_is_number(got) && v__ast__Type_is_number(expected)) { if (v__ast__Type_is_number(got) && v__ast__Type_is_number(expected)) {
if (v__ast__Type_alias_eq(got, _const_v__ast__rune_type) && v__ast__Type_alias_eq(expected, _const_v__ast__byte_type)) { if (v__ast__Type_alias_eq(got, _const_v__ast__rune_type) && v__ast__Type_alias_eq(expected, _const_v__ast__byte_type)) {
bool _t25 = true; bool _t27 = true;
return _t25; return _t27;
} else if (v__ast__Type_alias_eq(expected, _const_v__ast__rune_type) && v__ast__Type_alias_eq(got, _const_v__ast__byte_type)) { } else if (v__ast__Type_alias_eq(expected, _const_v__ast__rune_type) && v__ast__Type_alias_eq(got, _const_v__ast__byte_type)) {
bool _t26 = true; bool _t28 = true;
return _t26; return _t28;
} }
if (!v__ast__Type_alias_eq(v__checker__Checker_promote_num(c, expected, got), expected)) { if (!v__ast__Type_alias_eq(v__checker__Checker_promote_num(c, expected, got), expected)) {
bool _t27 = false; bool _t29 = false;
return _t27; return _t29;
} }
} }
if (v__ast__Type_has_flag(expected, v__ast__TypeFlag__generic)) { if (v__ast__Type_has_flag(expected, v__ast__TypeFlag__generic)) {
bool _t28 = false; bool _t30 = false;
return _t28; return _t30;
} }
bool _t29 = true; bool _t31 = true;
return _t29; return _t31;
} }
_option_void v__checker__Checker_check_expected_call_arg(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected_, v__ast__Language language, v__ast__CallArg arg) { _option_void v__checker__Checker_check_expected_call_arg(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected_, v__ast__Language language, v__ast__CallArg arg) {
@ -51160,10 +51171,10 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_promote_num(v__checker__Checker
v__ast__Type type_hi = left_type; v__ast__Type type_hi = left_type;
v__ast__Type type_lo = right_type; v__ast__Type type_lo = right_type;
if (v__ast__Type_idx(type_hi) < v__ast__Type_idx(type_lo)) { if (v__ast__Type_idx(type_hi) < v__ast__Type_idx(type_lo)) {
v__ast__Type _var_18083 = type_hi; v__ast__Type _var_18612 = type_hi;
v__ast__Type _var_18092 = type_lo; v__ast__Type _var_18621 = type_lo;
type_hi = _var_18092; type_hi = _var_18621;
type_lo = _var_18083; type_lo = _var_18612;
} }
int idx_hi = v__ast__Type_idx(type_hi); int idx_hi = v__ast__Type_idx(type_hi);
int idx_lo = v__ast__Type_idx(type_lo); int idx_lo = v__ast__Type_idx(type_lo);
@ -61801,6 +61812,8 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__
VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_sql_expr(v__checker__Checker* c, v__ast__SqlExpr* node) { VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_sql_expr(v__checker__Checker* c, v__ast__SqlExpr* node) {
bool v__checker__Checker_sql_expr_defer_0 = false; bool v__checker__Checker_sql_expr_defer_0 = false;
bool v__checker__Checker_sql_expr_defer_1 = false;
v__ast__TypeSymbol old_ts;
c->inside_sql = true; c->inside_sql = true;
v__checker__Checker_sql_expr_defer_0 = true; v__checker__Checker_sql_expr_defer_0 = true;
v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, node->table_expr.typ); v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, node->table_expr.typ);
@ -61817,11 +61830,18 @@ bool v__checker__Checker_sql_expr_defer_0 = false;
} }
; ;
old_ts = c->cur_orm_ts;
c->cur_orm_ts = *sym; c->cur_orm_ts = *sym;
v__checker__Checker_sql_expr_defer_1 = true;
if ((sym->info)._typ != 418 /* v.ast.Struct */) { if ((sym->info)._typ != 418 /* v.ast.Struct */) {
v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("The table symbol `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("` has to be a struct"), 0, { .d_c = 0 }}})), node->table_expr.pos); v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("The table symbol `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("` has to be a struct"), 0, { .d_c = 0 }}})), node->table_expr.pos);
v__ast__Type _t3 = _const_v__ast__void_type; v__ast__Type _t3 = _const_v__ast__void_type;
// Defer begin // Defer begin
if (v__checker__Checker_sql_expr_defer_1) {
c->cur_orm_ts = old_ts;
}
// Defer end
// Defer begin
if (v__checker__Checker_sql_expr_defer_0) { if (v__checker__Checker_sql_expr_defer_0) {
c->inside_sql = false; c->inside_sql = false;
} }
@ -61910,6 +61930,11 @@ bool v__checker__Checker_sql_expr_defer_0 = false;
v__checker__Checker_expr(c, node->db_expr); v__checker__Checker_expr(c, node->db_expr);
v__ast__Type _t8 = node->typ; v__ast__Type _t8 = node->typ;
// Defer begin // Defer begin
if (v__checker__Checker_sql_expr_defer_1) {
c->cur_orm_ts = old_ts;
}
// Defer end
// Defer begin
if (v__checker__Checker_sql_expr_defer_0) { if (v__checker__Checker_sql_expr_defer_0) {
c->inside_sql = false; c->inside_sql = false;
} }
@ -61933,6 +61958,8 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_sql_stmt(v__checker__Checker* c
VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_sql_stmt_line(v__checker__Checker* c, v__ast__SqlStmtLine* node) { VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_sql_stmt_line(v__checker__Checker* c, v__ast__SqlStmtLine* node) {
bool v__checker__Checker_sql_stmt_line_defer_0 = false; bool v__checker__Checker_sql_stmt_line_defer_0 = false;
bool v__checker__Checker_sql_stmt_line_defer_1 = false;
v__ast__TypeSymbol old_ts;
c->inside_sql = true; c->inside_sql = true;
v__checker__Checker_sql_stmt_line_defer_0 = true; v__checker__Checker_sql_stmt_line_defer_0 = true;
_option_void _t1 = v__checker__Checker_ensure_type_exists(c, node->table_expr.typ, node->pos); _option_void _t1 = v__checker__Checker_ensure_type_exists(c, node->table_expr.typ, node->pos);
@ -61949,11 +61976,18 @@ bool v__checker__Checker_sql_stmt_line_defer_0 = false;
; ;
v__ast__TypeSymbol* table_sym = v__ast__Table_sym(c->table, node->table_expr.typ); v__ast__TypeSymbol* table_sym = v__ast__Table_sym(c->table, node->table_expr.typ);
old_ts = c->cur_orm_ts;
c->cur_orm_ts = *table_sym; c->cur_orm_ts = *table_sym;
v__checker__Checker_sql_stmt_line_defer_1 = true;
if ((table_sym->info)._typ != 418 /* v.ast.Struct */) { if ((table_sym->info)._typ != 418 /* v.ast.Struct */) {
v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = table_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = table_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos);
v__ast__Type _t3 = _const_v__ast__void_type; v__ast__Type _t3 = _const_v__ast__void_type;
// Defer begin // Defer begin
if (v__checker__Checker_sql_stmt_line_defer_1) {
c->cur_orm_ts = old_ts;
}
// Defer end
// Defer begin
if (v__checker__Checker_sql_stmt_line_defer_0) { if (v__checker__Checker_sql_stmt_line_defer_0) {
c->inside_sql = false; c->inside_sql = false;
} }
@ -62022,6 +62056,11 @@ bool v__checker__Checker_sql_stmt_line_defer_0 = false;
} }
v__ast__Type _t11 = _const_v__ast__void_type; v__ast__Type _t11 = _const_v__ast__void_type;
// Defer begin // Defer begin
if (v__checker__Checker_sql_stmt_line_defer_1) {
c->cur_orm_ts = old_ts;
}
// Defer end
// Defer begin
if (v__checker__Checker_sql_stmt_line_defer_0) { if (v__checker__Checker_sql_stmt_line_defer_0) {
c->inside_sql = false; c->inside_sql = false;
} }
@ -78418,7 +78457,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE
if (left_sym->kind == v__ast__Kind__map && (string__eq(node.name, _SLIT("clone")) || string__eq(node.name, _SLIT("move")))) { if (left_sym->kind == v__ast__Kind__map && (string__eq(node.name, _SLIT("clone")) || string__eq(node.name, _SLIT("move")))) {
receiver_type_name = _SLIT("map"); receiver_type_name = _SLIT("map");
} }
if (final_left_sym->kind == v__ast__Kind__array && (string__eq(node.name, _SLIT("repeat")) || string__eq(node.name, _SLIT("sort_with_compare")) || string__eq(node.name, _SLIT("free")) || string__eq(node.name, _SLIT("push_many")) || string__eq(node.name, _SLIT("trim")) || string__eq(node.name, _SLIT("first")) || string__eq(node.name, _SLIT("last")) || string__eq(node.name, _SLIT("pop")) || string__eq(node.name, _SLIT("clone")) || string__eq(node.name, _SLIT("reverse")) || string__eq(node.name, _SLIT("slice")) || string__eq(node.name, _SLIT("pointers")))) { if (final_left_sym->kind == v__ast__Kind__array && !(left_sym->kind == v__ast__Kind__alias && v__ast__TypeSymbol_has_method(left_sym, node.name)) && (string__eq(node.name, _SLIT("repeat")) || string__eq(node.name, _SLIT("sort_with_compare")) || string__eq(node.name, _SLIT("free")) || string__eq(node.name, _SLIT("push_many")) || string__eq(node.name, _SLIT("trim")) || string__eq(node.name, _SLIT("first")) || string__eq(node.name, _SLIT("last")) || string__eq(node.name, _SLIT("pop")) || string__eq(node.name, _SLIT("clone")) || string__eq(node.name, _SLIT("reverse")) || string__eq(node.name, _SLIT("slice")) || string__eq(node.name, _SLIT("pointers")))) {
if (!((left_sym->info)._typ == 433 /* v.ast.Alias */ && v__ast__TypeSymbol_has_method(typ_sym, node.name))) { if (!((left_sym->info)._typ == 433 /* v.ast.Alias */ && v__ast__TypeSymbol_has_method(typ_sym, node.name))) {
receiver_type_name = _SLIT("array"); receiver_type_name = _SLIT("array");
} }
@ -78782,11 +78821,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr
} }
if (!print_auto_str) { if (!print_auto_str) {
if (g->pref->is_debug && string__eq(node.name, _SLIT("panic"))) { if (g->pref->is_debug && string__eq(node.name, _SLIT("panic"))) {
multi_return_int_string_string_string mr_39701 = v__gen__c__Gen_panic_debug_info(g, node.pos); multi_return_int_string_string_string mr_39765 = v__gen__c__Gen_panic_debug_info(g, node.pos);
int paline = mr_39701.arg0; int paline = mr_39765.arg0;
string pafile = mr_39701.arg1; string pafile = mr_39765.arg1;
string pamod = mr_39701.arg2; string pamod = mr_39765.arg2;
string pafn = mr_39701.arg3; string pafn = mr_39765.arg3;
v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("panic_debug("), /*100 &int*/0xfe07, {.d_i32 = paline}}, {_SLIT(", tos3(\""), /*115 &string*/0xfe10, {.d_s = pafile}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pamod}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pafn}}, {_SLIT("\"), "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("panic_debug("), /*100 &int*/0xfe07, {.d_i32 = paline}}, {_SLIT(", tos3(\""), /*115 &string*/0xfe10, {.d_s = pafile}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pamod}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pafn}}, {_SLIT("\"), "), 0, { .d_c = 0 }}})));
v__gen__c__Gen_call_args(g, node); v__gen__c__Gen_call_args(g, node);
v__gen__c__Gen_write(g, _SLIT(")")); v__gen__c__Gen_write(g, _SLIT(")"));
@ -80310,12 +80349,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_array(v__gen__c__Gen* g, v__ast__In
bool gen_or = node.or_expr.kind != v__ast__OrKind__absent || node.is_option; bool gen_or = node.or_expr.kind != v__ast__OrKind__absent || node.is_option;
bool left_is_ptr = v__ast__Type_is_ptr(node.left_type); bool left_is_ptr = v__ast__Type_is_ptr(node.left_type);
v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym.info)._v__ast__Array,(sym.info)._typ, 413) /*expected idx: 413, name: v.ast.Array */ ; v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym.info)._v__ast__Array,(sym.info)._typ, 413) /*expected idx: 413, name: v.ast.Array */ ;
string elem_type_str = v__gen__c__Gen_typ(g, info.elem_type);
v__ast__Type elem_type = info.elem_type; v__ast__Type elem_type = info.elem_type;
v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(g->table, elem_type); v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(g->table, elem_type);
if (elem_sym->kind == v__ast__Kind__function) { string elem_type_str = (elem_sym->kind == v__ast__Kind__function ? (_SLIT("voidptr")) : (v__gen__c__Gen_typ(g, info.elem_type)));
elem_type_str = _SLIT("voidptr");
}
if (g->is_assign_lhs && node.is_setter) { if (g->is_assign_lhs && node.is_setter) {
bool is_direct_array_access = (g->fn_decl != 0 && g->fn_decl->is_direct_arr) || node.is_direct; bool is_direct_array_access = (g->fn_decl != 0 && g->fn_decl->is_direct_arr) || node.is_direct;
bool is_op_assign = g->assign_op != v__token__Kind__assign && !v__ast__Type_alias_eq(info.elem_type, _const_v__ast__string_type); bool is_op_assign = g->assign_op != v__token__Kind__assign && !v__ast__Type_alias_eq(info.elem_type, _const_v__ast__string_type);
@ -80485,11 +80521,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_map(v__gen__c__Gen* g, v__ast__Inde
v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym.info)._v__ast__Map,(sym.info)._typ, 414) /*expected idx: 414, name: v.ast.Map */ ; v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym.info)._v__ast__Map,(sym.info)._typ, 414) /*expected idx: 414, name: v.ast.Map */ ;
string key_type_str = v__gen__c__Gen_typ(g, info.key_type); string key_type_str = v__gen__c__Gen_typ(g, info.key_type);
v__ast__Type elem_type = info.value_type; v__ast__Type elem_type = info.value_type;
string elem_type_str = v__gen__c__Gen_typ(g, elem_type);
v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(g->table, elem_type); v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(g->table, elem_type);
if (elem_sym->kind == v__ast__Kind__function) { string elem_type_str = (elem_sym->kind == v__ast__Kind__function ? (_SLIT("voidptr")) : (v__gen__c__Gen_typ(g, elem_type)));
elem_type_str = _SLIT("voidptr");
}
bool get_and_set_types = (elem_sym->kind == v__ast__Kind__struct_ || elem_sym->kind == v__ast__Kind__map); bool get_and_set_types = (elem_sym->kind == v__ast__Kind__struct_ || elem_sym->kind == v__ast__Kind__map);
if (g->is_assign_lhs && !g->is_arraymap_set && !get_and_set_types) { if (g->is_assign_lhs && !g->is_arraymap_set && !get_and_set_types) {
if (g->assign_op == v__token__Kind__assign || v__ast__Type_alias_eq(info.value_type, _const_v__ast__string_type)) { if (g->assign_op == v__token__Kind__assign || v__ast__Type_alias_eq(info.value_type, _const_v__ast__string_type)) {
@ -89842,12 +89875,12 @@ v__ast__Type v__parser__Parser_parse_map_type(v__parser__Parser* p) {
} }
v__parser__Parser_check(p, v__token__Kind__lsbr); v__parser__Parser_check(p, v__token__Kind__lsbr);
v__ast__Type key_type = v__parser__Parser_parse_type(p); v__ast__Type key_type = v__parser__Parser_parse_type(p);
v__ast__TypeSymbol* key_sym = v__ast__Table_sym(p->table, key_type);
bool is_alias = key_sym->kind == v__ast__Kind__alias;
if (v__ast__Type_idx(key_type) == 0) { if (v__ast__Type_idx(key_type) == 0) {
v__ast__Type _t2 = 0; v__ast__Type _t2 = 0;
return _t2; return _t2;
} }
v__ast__TypeSymbol* key_sym = v__ast__Table_sym(p->table, key_type);
bool is_alias = key_sym->kind == v__ast__Kind__alias;
bool key_type_supported = (key_type == _const_v__ast__string_type_idx || key_type == _const_v__ast__voidptr_type_idx) || (key_sym->kind == v__ast__Kind__enum_ || key_sym->kind == v__ast__Kind__placeholder || key_sym->kind == v__ast__Kind__any) || ((v__ast__Type_is_int(key_type) || v__ast__Type_is_float(key_type) || is_alias) && !v__ast__Type_is_ptr(key_type)); bool key_type_supported = (key_type == _const_v__ast__string_type_idx || key_type == _const_v__ast__voidptr_type_idx) || (key_sym->kind == v__ast__Kind__enum_ || key_sym->kind == v__ast__Kind__placeholder || key_sym->kind == v__ast__Kind__any) || ((v__ast__Type_is_int(key_type) || v__ast__Type_is_float(key_type) || is_alias) && !v__ast__Type_is_ptr(key_type));
if (!key_type_supported) { if (!key_type_supported) {
if (is_alias) { if (is_alias) {
@ -96450,7 +96483,8 @@ bool v__builder__Builder_print_warnings_and_errors_defer_0 = false;
} }
} }
if (redefines.len > 0) { if (redefines.len > 0) {
eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of function `"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); string ferror = v__util__formatted_error(_SLIT("builder error:"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of function `"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), _SLIT(""), ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,}));
eprintln(ferror);
for (int _t15 = 0; _t15 < redefines.len; ++_t15) { for (int _t15 = 0; _t15 < redefines.len; ++_t15) {
v__builder__FunctionRedefinition redefine = ((v__builder__FunctionRedefinition*)redefines.data)[_t15]; v__builder__FunctionRedefinition redefine = ((v__builder__FunctionRedefinition*)redefines.data)[_t15];
eprintln(v__util__formatted_error(_SLIT("conflicting declaration:"), redefine.fheader, redefine.fpath, redefine.f.pos)); eprintln(v__util__formatted_error(_SLIT("conflicting declaration:"), redefine.fheader, redefine.fpath, redefine.f.pos));

192
v_win.c
View File

@ -1,11 +1,11 @@
#define V_COMMIT_HASH "12ec3b9d5" #define V_COMMIT_HASH "9a0f49950"
#ifndef V_COMMIT_HASH #ifndef V_COMMIT_HASH
#define V_COMMIT_HASH "b10cf3e0f" #define V_COMMIT_HASH "12ec3b9d5"
#endif #endif
#ifndef V_CURRENT_COMMIT_HASH #ifndef V_CURRENT_COMMIT_HASH
#define V_CURRENT_COMMIT_HASH "12ec3b9" #define V_CURRENT_COMMIT_HASH "9a0f499"
#endif #endif
// V comptime_definitions: // V comptime_definitions:
@ -36525,7 +36525,7 @@ void v__pref__Preferences_fill_with_defaults(v__pref__Preferences* p) {
if ((p->third_party_option).len == 0) { if ((p->third_party_option).len == 0) {
p->third_party_option = p->cflags; p->third_party_option = p->cflags;
} }
string vhash = _SLIT("b10cf3e0f"); string vhash = _SLIT("12ec3b9d5");
p->cache_manager = v__vcache__new_cache_manager(new_array_from_c_array(7, 7, sizeof(string), _MOV((string[7]){string_clone(vhash), str_intp(6, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.pref.Backend*/0xfe10, {.d_s = v__pref__Backend_str(p->backend)}}, {_SLIT(" | "), /*115 &v.pref.OS*/0xfe10, {.d_s = v__pref__OS_str(p->os)}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = p->ccompiler}}, {_SLIT(" | "), /*115 &bool*/0xfe10, {.d_s = p->is_prod ? _SLIT("true") : _SLIT("false")}}, {_SLIT(" | "), /*115 &bool*/0xfe10, {.d_s = p->sanitize ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}})), string_clone(string_trim_space(p->cflags)), string_clone(string_trim_space(p->third_party_option)), string_clone(Array_string_str(p->compile_defines_all)), string_clone(Array_string_str(p->compile_defines)), string_clone(Array_string_str(p->lookup_path))}))); p->cache_manager = v__vcache__new_cache_manager(new_array_from_c_array(7, 7, sizeof(string), _MOV((string[7]){string_clone(vhash), str_intp(6, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.pref.Backend*/0xfe10, {.d_s = v__pref__Backend_str(p->backend)}}, {_SLIT(" | "), /*115 &v.pref.OS*/0xfe10, {.d_s = v__pref__OS_str(p->os)}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = p->ccompiler}}, {_SLIT(" | "), /*115 &bool*/0xfe10, {.d_s = p->is_prod ? _SLIT("true") : _SLIT("false")}}, {_SLIT(" | "), /*115 &bool*/0xfe10, {.d_s = p->sanitize ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}})), string_clone(string_trim_space(p->cflags)), string_clone(string_trim_space(p->third_party_option)), string_clone(Array_string_str(p->compile_defines_all)), string_clone(Array_string_str(p->compile_defines)), string_clone(Array_string_str(p->lookup_path))})));
if (string__eq(os__user_os(), _SLIT("windows"))) { if (string__eq(os__user_os(), _SLIT("windows"))) {
p->use_cache = false; p->use_cache = false;
@ -39055,7 +39055,7 @@ string v__util__formatted_error(string kind, string omsg, string filepath, v__to
path = string_replace_once(path, _const_v__util__normalised_workdir, _SLIT("")); path = string_replace_once(path, _const_v__util__normalised_workdir, _SLIT(""));
} }
} }
string position = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT(":"), /*100 &int*/0xfe07, {.d_i32 = pos.line_nr + 1}}, {_SLIT(":"), /*100 &int*/0xfe07, {.d_i32 = v__mathutil__max_T_int(1, pos.col + 1)}}, {_SLIT(":"), 0, { .d_c = 0 }}})); string position = (filepath.len > 0 ? ( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT(":"), /*100 &int*/0xfe07, {.d_i32 = pos.line_nr + 1}}, {_SLIT(":"), /*100 &int*/0xfe07, {.d_i32 = v__mathutil__max_T_int(1, pos.col + 1)}}, {_SLIT(":"), 0, { .d_c = 0 }}}))) : (_SLIT("")));
string scontext = Array_string_join(v__util__source_file_context(kind, filepath, pos), _SLIT("\n")); string scontext = Array_string_join(v__util__source_file_context(kind, filepath, pos), _SLIT("\n"));
string final_position = v__util__bold(position); string final_position = v__util__bold(position);
string final_kind = v__util__bold(v__util__color(kind, kind)); string final_kind = v__util__bold(v__util__color(kind, kind));
@ -48768,117 +48768,128 @@ bool v__checker__Checker_check_types(v__checker__Checker* c, v__ast__Type got, v
} }
v__ast__TypeSymbol* got_sym = v__ast__Table_sym(c->table, got); v__ast__TypeSymbol* got_sym = v__ast__Table_sym(c->table, got);
v__ast__TypeSymbol* expected_sym = v__ast__Table_sym(c->table, expected); v__ast__TypeSymbol* expected_sym = v__ast__Table_sym(c->table, expected);
if (got_sym->kind == v__ast__Kind__enum_) { if (got_sym->kind == v__ast__Kind__array && expected_sym->kind == v__ast__Kind__array) {
if (v__ast__TypeSymbol_is_number(expected_sym)) { if (v__ast__Type_is_any_kind_of_pointer((/* as */ *(v__ast__Array*)__as_cast((got_sym->info)._v__ast__Array,(got_sym->info)._typ, 452) /*expected idx: 452, name: v.ast.Array */ ).elem_type) && v__ast__Type_is_any_kind_of_pointer((/* as */ *(v__ast__Array*)__as_cast((expected_sym->info)._v__ast__Array,(expected_sym->info)._typ, 452) /*expected idx: 452, name: v.ast.Array */ ).elem_type)) {
bool _t8 = true; bool _t8 = true;
return _t8; return _t8;
} }
} else if (got_sym->kind == v__ast__Kind__array_fixed) { } else if (got_sym->kind == v__ast__Kind__array_fixed && expected_sym->kind == v__ast__Kind__array_fixed) {
if (v__ast__TypeSymbol_is_number(expected_sym) || v__ast__Type_is_any_kind_of_pointer(expected)) { if (v__ast__Type_is_any_kind_of_pointer((/* as */ *(v__ast__ArrayFixed*)__as_cast((got_sym->info)._v__ast__ArrayFixed,(got_sym->info)._typ, 480) /*expected idx: 480, name: v.ast.ArrayFixed */ ).elem_type) && v__ast__Type_is_any_kind_of_pointer((/* as */ *(v__ast__ArrayFixed*)__as_cast((expected_sym->info)._v__ast__ArrayFixed,(expected_sym->info)._typ, 480) /*expected idx: 480, name: v.ast.ArrayFixed */ ).elem_type)) {
bool _t9 = true; bool _t9 = true;
return _t9; return _t9;
} }
} else if (expected_sym->kind == v__ast__Kind__array_fixed) { }
if (v__ast__TypeSymbol_is_number(got_sym) && v__ast__Type_is_any_kind_of_pointer(got)) { if (got_sym->kind == v__ast__Kind__enum_) {
if (v__ast__TypeSymbol_is_number(expected_sym)) {
bool _t10 = true; bool _t10 = true;
return _t10; return _t10;
}
} else if (got_sym->kind == v__ast__Kind__array_fixed) {
if (v__ast__TypeSymbol_is_number(expected_sym) || v__ast__Type_is_any_kind_of_pointer(expected)) {
bool _t11 = true;
return _t11;
}
} else if (expected_sym->kind == v__ast__Kind__array_fixed) {
if (v__ast__TypeSymbol_is_number(got_sym) && v__ast__Type_is_any_kind_of_pointer(got)) {
bool _t12 = true;
return _t12;
} else if (got_sym->kind == v__ast__Kind__array) { } else if (got_sym->kind == v__ast__Kind__array) {
v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((expected_sym->info)._v__ast__ArrayFixed,(expected_sym->info)._typ, 480) /*expected idx: 480, name: v.ast.ArrayFixed */ ; v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((expected_sym->info)._v__ast__ArrayFixed,(expected_sym->info)._typ, 480) /*expected idx: 480, name: v.ast.ArrayFixed */ ;
v__ast__Array info2 = /* as */ *(v__ast__Array*)__as_cast((got_sym->info)._v__ast__Array,(got_sym->info)._typ, 452) /*expected idx: 452, name: v.ast.Array */ ; v__ast__Array info2 = /* as */ *(v__ast__Array*)__as_cast((got_sym->info)._v__ast__Array,(got_sym->info)._typ, 452) /*expected idx: 452, name: v.ast.Array */ ;
if (v__checker__Checker_check_types(c, info.elem_type, info2.elem_type)) { if (v__checker__Checker_check_types(c, info.elem_type, info2.elem_type)) {
bool _t11 = true;
return _t11;
}
}
} else if (got_sym->kind == v__ast__Kind__array) {
if (v__ast__TypeSymbol_is_number(expected_sym) || v__ast__Type_is_any_kind_of_pointer(expected)) {
bool _t12 = true;
return _t12;
}
} else if (expected_sym->kind == v__ast__Kind__array) {
if (v__ast__TypeSymbol_is_number(got_sym) && v__ast__Type_is_any_kind_of_pointer(got)) {
bool _t13 = true; bool _t13 = true;
return _t13; return _t13;
} }
} }
if (expected_sym->kind == v__ast__Kind__enum_ && v__ast__TypeSymbol_is_number(got_sym)) { } else if (got_sym->kind == v__ast__Kind__array) {
if (v__ast__TypeSymbol_is_number(expected_sym) || v__ast__Type_is_any_kind_of_pointer(expected)) {
bool _t14 = true; bool _t14 = true;
return _t14; return _t14;
} }
if (got_is_ptr && exp_is_ptr) { } else if (expected_sym->kind == v__ast__Kind__array) {
if (v__ast__TypeSymbol_is_number(expected_sym) && v__ast__TypeSymbol_is_number(got_sym)) { if (v__ast__TypeSymbol_is_number(got_sym) && v__ast__Type_is_any_kind_of_pointer(got)) {
bool _t15 = true; bool _t15 = true;
return _t15; return _t15;
} }
} }
if (expected_sym->kind == v__ast__Kind__enum_ && v__ast__TypeSymbol_is_number(got_sym)) {
bool _t16 = true;
return _t16;
}
if (got_is_ptr && exp_is_ptr) {
if (v__ast__TypeSymbol_is_number(expected_sym) && v__ast__TypeSymbol_is_number(got_sym)) {
bool _t17 = true;
return _t17;
}
}
} }
if (got_is_ptr && exp_is_ptr) { if (got_is_ptr && exp_is_ptr) {
if (v__ast__Type_nr_muls(got) != v__ast__Type_nr_muls(expected)) { if (v__ast__Type_nr_muls(got) != v__ast__Type_nr_muls(expected)) {
bool _t16 = false; bool _t18 = false;
return _t16; return _t18;
} }
} }
int exp_idx = v__ast__Type_idx(expected); int exp_idx = v__ast__Type_idx(expected);
int got_idx = v__ast__Type_idx(got); int got_idx = v__ast__Type_idx(got);
if (exp_idx == got_idx) { if (exp_idx == got_idx) {
bool _t17 = true;
return _t17;
}
if (exp_idx == _const_v__ast__voidptr_type_idx || exp_idx == _const_v__ast__byteptr_type_idx || (v__ast__Type_is_ptr(expected) && v__ast__Type_idx(v__ast__Type_deref(expected)) == _const_v__ast__byte_type_idx)) {
if (v__ast__Type_is_ptr(got) || v__ast__Type_is_pointer(got)) {
bool _t18 = true;
return _t18;
}
}
if (v__ast__Type_is_real_pointer(expected)) {
if (v__ast__Type_alias_eq(got, _const_v__ast__int_literal_type)) {
bool _t19 = true; bool _t19 = true;
return _t19; return _t19;
} }
} if (exp_idx == _const_v__ast__voidptr_type_idx || exp_idx == _const_v__ast__byteptr_type_idx || (v__ast__Type_is_ptr(expected) && v__ast__Type_idx(v__ast__Type_deref(expected)) == _const_v__ast__byte_type_idx)) {
if (got_idx == _const_v__ast__voidptr_type_idx || got_idx == _const_v__ast__byteptr_type_idx || (got_idx == _const_v__ast__byte_type_idx && v__ast__Type_is_ptr(got))) { if (v__ast__Type_is_ptr(got) || v__ast__Type_is_pointer(got)) {
if (v__ast__Type_is_ptr(expected) || v__ast__Type_is_pointer(expected)) {
bool _t20 = true; bool _t20 = true;
return _t20; return _t20;
} }
} }
if (v__ast__Type_alias_eq(expected, _const_v__ast__charptr_type) && v__ast__Type_alias_eq(got, v__ast__Type_ref(_const_v__ast__char_type))) { if (v__ast__Type_is_real_pointer(expected)) {
if (v__ast__Type_alias_eq(got, _const_v__ast__int_literal_type)) {
bool _t21 = true; bool _t21 = true;
return _t21; return _t21;
} }
}
if (got_idx == _const_v__ast__voidptr_type_idx || got_idx == _const_v__ast__byteptr_type_idx || (got_idx == _const_v__ast__byte_type_idx && v__ast__Type_is_ptr(got))) {
if (v__ast__Type_is_ptr(expected) || v__ast__Type_is_pointer(expected)) {
bool _t22 = true;
return _t22;
}
}
if (v__ast__Type_alias_eq(expected, _const_v__ast__charptr_type) && v__ast__Type_alias_eq(got, v__ast__Type_ref(_const_v__ast__char_type))) {
bool _t23 = true;
return _t23;
}
if (v__ast__Type_has_flag(expected, v__ast__TypeFlag__optional) || v__ast__Type_has_flag(expected, v__ast__TypeFlag__result)) { if (v__ast__Type_has_flag(expected, v__ast__TypeFlag__optional) || v__ast__Type_has_flag(expected, v__ast__TypeFlag__result)) {
v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, got); v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, got);
if (((sym->idx == _const_v__ast__error_type_idx || (v__ast__Type_alias_eq(got, _const_v__ast__none_type) || v__ast__Type_alias_eq(got, _const_v__ast__error_type))) && v__ast__Type_has_flag(expected, v__ast__TypeFlag__optional)) || ((sym->idx == _const_v__ast__error_type_idx || v__ast__Type_alias_eq(got, _const_v__ast__error_type)) && v__ast__Type_has_flag(expected, v__ast__TypeFlag__result))) { if (((sym->idx == _const_v__ast__error_type_idx || (v__ast__Type_alias_eq(got, _const_v__ast__none_type) || v__ast__Type_alias_eq(got, _const_v__ast__error_type))) && v__ast__Type_has_flag(expected, v__ast__TypeFlag__optional)) || ((sym->idx == _const_v__ast__error_type_idx || v__ast__Type_alias_eq(got, _const_v__ast__error_type)) && v__ast__Type_has_flag(expected, v__ast__TypeFlag__result))) {
bool _t22 = true; bool _t24 = true;
return _t22; return _t24;
} else if (!v__checker__Checker_check_basic(c, got, v__ast__Type_clear_flag(v__ast__Type_clear_flag(expected, v__ast__TypeFlag__optional), v__ast__TypeFlag__result))) { } else if (!v__checker__Checker_check_basic(c, got, v__ast__Type_clear_flag(v__ast__Type_clear_flag(expected, v__ast__TypeFlag__optional), v__ast__TypeFlag__result))) {
bool _t23 = false; bool _t25 = false;
return _t23; return _t25;
} }
} }
if (!v__checker__Checker_check_basic(c, got, expected)) { if (!v__checker__Checker_check_basic(c, got, expected)) {
bool _t24 = false; bool _t26 = false;
return _t24; return _t26;
} }
if (v__ast__Type_is_number(got) && v__ast__Type_is_number(expected)) { if (v__ast__Type_is_number(got) && v__ast__Type_is_number(expected)) {
if (v__ast__Type_alias_eq(got, _const_v__ast__rune_type) && v__ast__Type_alias_eq(expected, _const_v__ast__byte_type)) { if (v__ast__Type_alias_eq(got, _const_v__ast__rune_type) && v__ast__Type_alias_eq(expected, _const_v__ast__byte_type)) {
bool _t25 = true; bool _t27 = true;
return _t25; return _t27;
} else if (v__ast__Type_alias_eq(expected, _const_v__ast__rune_type) && v__ast__Type_alias_eq(got, _const_v__ast__byte_type)) { } else if (v__ast__Type_alias_eq(expected, _const_v__ast__rune_type) && v__ast__Type_alias_eq(got, _const_v__ast__byte_type)) {
bool _t26 = true; bool _t28 = true;
return _t26; return _t28;
} }
if (!v__ast__Type_alias_eq(v__checker__Checker_promote_num(c, expected, got), expected)) { if (!v__ast__Type_alias_eq(v__checker__Checker_promote_num(c, expected, got), expected)) {
bool _t27 = false; bool _t29 = false;
return _t27; return _t29;
} }
} }
if (v__ast__Type_has_flag(expected, v__ast__TypeFlag__generic)) { if (v__ast__Type_has_flag(expected, v__ast__TypeFlag__generic)) {
bool _t28 = false; bool _t30 = false;
return _t28; return _t30;
} }
bool _t29 = true; bool _t31 = true;
return _t29; return _t31;
} }
_option_void v__checker__Checker_check_expected_call_arg(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected_, v__ast__Language language, v__ast__CallArg arg) { _option_void v__checker__Checker_check_expected_call_arg(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected_, v__ast__Language language, v__ast__CallArg arg) {
@ -49226,10 +49237,10 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_promote_num(v__checker__Checker
v__ast__Type type_hi = left_type; v__ast__Type type_hi = left_type;
v__ast__Type type_lo = right_type; v__ast__Type type_lo = right_type;
if (v__ast__Type_idx(type_hi) < v__ast__Type_idx(type_lo)) { if (v__ast__Type_idx(type_hi) < v__ast__Type_idx(type_lo)) {
v__ast__Type _var_18083 = type_hi; v__ast__Type _var_18612 = type_hi;
v__ast__Type _var_18092 = type_lo; v__ast__Type _var_18621 = type_lo;
type_hi = _var_18092; type_hi = _var_18621;
type_lo = _var_18083; type_lo = _var_18612;
} }
int idx_hi = v__ast__Type_idx(type_hi); int idx_hi = v__ast__Type_idx(type_hi);
int idx_lo = v__ast__Type_idx(type_lo); int idx_lo = v__ast__Type_idx(type_lo);
@ -59799,6 +59810,8 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__
VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_sql_expr(v__checker__Checker* c, v__ast__SqlExpr* node) { VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_sql_expr(v__checker__Checker* c, v__ast__SqlExpr* node) {
bool v__checker__Checker_sql_expr_defer_0 = false; bool v__checker__Checker_sql_expr_defer_0 = false;
bool v__checker__Checker_sql_expr_defer_1 = false;
v__ast__TypeSymbol old_ts;
c->inside_sql = true; c->inside_sql = true;
v__checker__Checker_sql_expr_defer_0 = true; v__checker__Checker_sql_expr_defer_0 = true;
v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, node->table_expr.typ); v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, node->table_expr.typ);
@ -59815,11 +59828,18 @@ bool v__checker__Checker_sql_expr_defer_0 = false;
} }
; ;
old_ts = c->cur_orm_ts;
c->cur_orm_ts = *sym; c->cur_orm_ts = *sym;
v__checker__Checker_sql_expr_defer_1 = true;
if ((sym->info)._typ != 457 /* v.ast.Struct */) { if ((sym->info)._typ != 457 /* v.ast.Struct */) {
v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("The table symbol `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("` has to be a struct"), 0, { .d_c = 0 }}})), node->table_expr.pos); v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("The table symbol `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("` has to be a struct"), 0, { .d_c = 0 }}})), node->table_expr.pos);
v__ast__Type _t3 = _const_v__ast__void_type; v__ast__Type _t3 = _const_v__ast__void_type;
// Defer begin // Defer begin
if (v__checker__Checker_sql_expr_defer_1) {
c->cur_orm_ts = old_ts;
}
// Defer end
// Defer begin
if (v__checker__Checker_sql_expr_defer_0) { if (v__checker__Checker_sql_expr_defer_0) {
c->inside_sql = false; c->inside_sql = false;
} }
@ -59908,6 +59928,11 @@ bool v__checker__Checker_sql_expr_defer_0 = false;
v__checker__Checker_expr(c, node->db_expr); v__checker__Checker_expr(c, node->db_expr);
v__ast__Type _t8 = node->typ; v__ast__Type _t8 = node->typ;
// Defer begin // Defer begin
if (v__checker__Checker_sql_expr_defer_1) {
c->cur_orm_ts = old_ts;
}
// Defer end
// Defer begin
if (v__checker__Checker_sql_expr_defer_0) { if (v__checker__Checker_sql_expr_defer_0) {
c->inside_sql = false; c->inside_sql = false;
} }
@ -59931,6 +59956,8 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_sql_stmt(v__checker__Checker* c
VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_sql_stmt_line(v__checker__Checker* c, v__ast__SqlStmtLine* node) { VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_sql_stmt_line(v__checker__Checker* c, v__ast__SqlStmtLine* node) {
bool v__checker__Checker_sql_stmt_line_defer_0 = false; bool v__checker__Checker_sql_stmt_line_defer_0 = false;
bool v__checker__Checker_sql_stmt_line_defer_1 = false;
v__ast__TypeSymbol old_ts;
c->inside_sql = true; c->inside_sql = true;
v__checker__Checker_sql_stmt_line_defer_0 = true; v__checker__Checker_sql_stmt_line_defer_0 = true;
_option_void _t1 = v__checker__Checker_ensure_type_exists(c, node->table_expr.typ, node->pos); _option_void _t1 = v__checker__Checker_ensure_type_exists(c, node->table_expr.typ, node->pos);
@ -59947,11 +59974,18 @@ bool v__checker__Checker_sql_stmt_line_defer_0 = false;
; ;
v__ast__TypeSymbol* table_sym = v__ast__Table_sym(c->table, node->table_expr.typ); v__ast__TypeSymbol* table_sym = v__ast__Table_sym(c->table, node->table_expr.typ);
old_ts = c->cur_orm_ts;
c->cur_orm_ts = *table_sym; c->cur_orm_ts = *table_sym;
v__checker__Checker_sql_stmt_line_defer_1 = true;
if ((table_sym->info)._typ != 457 /* v.ast.Struct */) { if ((table_sym->info)._typ != 457 /* v.ast.Struct */) {
v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = table_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = table_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos);
v__ast__Type _t3 = _const_v__ast__void_type; v__ast__Type _t3 = _const_v__ast__void_type;
// Defer begin // Defer begin
if (v__checker__Checker_sql_stmt_line_defer_1) {
c->cur_orm_ts = old_ts;
}
// Defer end
// Defer begin
if (v__checker__Checker_sql_stmt_line_defer_0) { if (v__checker__Checker_sql_stmt_line_defer_0) {
c->inside_sql = false; c->inside_sql = false;
} }
@ -60020,6 +60054,11 @@ bool v__checker__Checker_sql_stmt_line_defer_0 = false;
} }
v__ast__Type _t11 = _const_v__ast__void_type; v__ast__Type _t11 = _const_v__ast__void_type;
// Defer begin // Defer begin
if (v__checker__Checker_sql_stmt_line_defer_1) {
c->cur_orm_ts = old_ts;
}
// Defer end
// Defer begin
if (v__checker__Checker_sql_stmt_line_defer_0) { if (v__checker__Checker_sql_stmt_line_defer_0) {
c->inside_sql = false; c->inside_sql = false;
} }
@ -76132,7 +76171,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE
if (left_sym->kind == v__ast__Kind__map && (string__eq(node.name, _SLIT("clone")) || string__eq(node.name, _SLIT("move")))) { if (left_sym->kind == v__ast__Kind__map && (string__eq(node.name, _SLIT("clone")) || string__eq(node.name, _SLIT("move")))) {
receiver_type_name = _SLIT("map"); receiver_type_name = _SLIT("map");
} }
if (final_left_sym->kind == v__ast__Kind__array && (string__eq(node.name, _SLIT("repeat")) || string__eq(node.name, _SLIT("sort_with_compare")) || string__eq(node.name, _SLIT("free")) || string__eq(node.name, _SLIT("push_many")) || string__eq(node.name, _SLIT("trim")) || string__eq(node.name, _SLIT("first")) || string__eq(node.name, _SLIT("last")) || string__eq(node.name, _SLIT("pop")) || string__eq(node.name, _SLIT("clone")) || string__eq(node.name, _SLIT("reverse")) || string__eq(node.name, _SLIT("slice")) || string__eq(node.name, _SLIT("pointers")))) { if (final_left_sym->kind == v__ast__Kind__array && !(left_sym->kind == v__ast__Kind__alias && v__ast__TypeSymbol_has_method(left_sym, node.name)) && (string__eq(node.name, _SLIT("repeat")) || string__eq(node.name, _SLIT("sort_with_compare")) || string__eq(node.name, _SLIT("free")) || string__eq(node.name, _SLIT("push_many")) || string__eq(node.name, _SLIT("trim")) || string__eq(node.name, _SLIT("first")) || string__eq(node.name, _SLIT("last")) || string__eq(node.name, _SLIT("pop")) || string__eq(node.name, _SLIT("clone")) || string__eq(node.name, _SLIT("reverse")) || string__eq(node.name, _SLIT("slice")) || string__eq(node.name, _SLIT("pointers")))) {
if (!((left_sym->info)._typ == 472 /* v.ast.Alias */ && v__ast__TypeSymbol_has_method(typ_sym, node.name))) { if (!((left_sym->info)._typ == 472 /* v.ast.Alias */ && v__ast__TypeSymbol_has_method(typ_sym, node.name))) {
receiver_type_name = _SLIT("array"); receiver_type_name = _SLIT("array");
} }
@ -76496,11 +76535,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr
} }
if (!print_auto_str) { if (!print_auto_str) {
if (g->pref->is_debug && string__eq(node.name, _SLIT("panic"))) { if (g->pref->is_debug && string__eq(node.name, _SLIT("panic"))) {
multi_return_int_string_string_string mr_39701 = v__gen__c__Gen_panic_debug_info(g, node.pos); multi_return_int_string_string_string mr_39765 = v__gen__c__Gen_panic_debug_info(g, node.pos);
int paline = mr_39701.arg0; int paline = mr_39765.arg0;
string pafile = mr_39701.arg1; string pafile = mr_39765.arg1;
string pamod = mr_39701.arg2; string pamod = mr_39765.arg2;
string pafn = mr_39701.arg3; string pafn = mr_39765.arg3;
v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("panic_debug("), /*100 &int*/0xfe07, {.d_i32 = paline}}, {_SLIT(", tos3(\""), /*115 &string*/0xfe10, {.d_s = pafile}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pamod}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pafn}}, {_SLIT("\"), "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("panic_debug("), /*100 &int*/0xfe07, {.d_i32 = paline}}, {_SLIT(", tos3(\""), /*115 &string*/0xfe10, {.d_s = pafile}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pamod}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pafn}}, {_SLIT("\"), "), 0, { .d_c = 0 }}})));
v__gen__c__Gen_call_args(g, node); v__gen__c__Gen_call_args(g, node);
v__gen__c__Gen_write(g, _SLIT(")")); v__gen__c__Gen_write(g, _SLIT(")"));
@ -78024,12 +78063,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_array(v__gen__c__Gen* g, v__ast__In
bool gen_or = node.or_expr.kind != v__ast__OrKind__absent || node.is_option; bool gen_or = node.or_expr.kind != v__ast__OrKind__absent || node.is_option;
bool left_is_ptr = v__ast__Type_is_ptr(node.left_type); bool left_is_ptr = v__ast__Type_is_ptr(node.left_type);
v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym.info)._v__ast__Array,(sym.info)._typ, 452) /*expected idx: 452, name: v.ast.Array */ ; v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym.info)._v__ast__Array,(sym.info)._typ, 452) /*expected idx: 452, name: v.ast.Array */ ;
string elem_type_str = v__gen__c__Gen_typ(g, info.elem_type);
v__ast__Type elem_type = info.elem_type; v__ast__Type elem_type = info.elem_type;
v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(g->table, elem_type); v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(g->table, elem_type);
if (elem_sym->kind == v__ast__Kind__function) { string elem_type_str = (elem_sym->kind == v__ast__Kind__function ? (_SLIT("voidptr")) : (v__gen__c__Gen_typ(g, info.elem_type)));
elem_type_str = _SLIT("voidptr");
}
if (g->is_assign_lhs && node.is_setter) { if (g->is_assign_lhs && node.is_setter) {
bool is_direct_array_access = (g->fn_decl != 0 && g->fn_decl->is_direct_arr) || node.is_direct; bool is_direct_array_access = (g->fn_decl != 0 && g->fn_decl->is_direct_arr) || node.is_direct;
bool is_op_assign = g->assign_op != v__token__Kind__assign && !v__ast__Type_alias_eq(info.elem_type, _const_v__ast__string_type); bool is_op_assign = g->assign_op != v__token__Kind__assign && !v__ast__Type_alias_eq(info.elem_type, _const_v__ast__string_type);
@ -78199,11 +78235,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_map(v__gen__c__Gen* g, v__ast__Inde
v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym.info)._v__ast__Map,(sym.info)._typ, 453) /*expected idx: 453, name: v.ast.Map */ ; v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym.info)._v__ast__Map,(sym.info)._typ, 453) /*expected idx: 453, name: v.ast.Map */ ;
string key_type_str = v__gen__c__Gen_typ(g, info.key_type); string key_type_str = v__gen__c__Gen_typ(g, info.key_type);
v__ast__Type elem_type = info.value_type; v__ast__Type elem_type = info.value_type;
string elem_type_str = v__gen__c__Gen_typ(g, elem_type);
v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(g->table, elem_type); v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(g->table, elem_type);
if (elem_sym->kind == v__ast__Kind__function) { string elem_type_str = (elem_sym->kind == v__ast__Kind__function ? (_SLIT("voidptr")) : (v__gen__c__Gen_typ(g, elem_type)));
elem_type_str = _SLIT("voidptr");
}
bool get_and_set_types = (elem_sym->kind == v__ast__Kind__struct_ || elem_sym->kind == v__ast__Kind__map); bool get_and_set_types = (elem_sym->kind == v__ast__Kind__struct_ || elem_sym->kind == v__ast__Kind__map);
if (g->is_assign_lhs && !g->is_arraymap_set && !get_and_set_types) { if (g->is_assign_lhs && !g->is_arraymap_set && !get_and_set_types) {
if (g->assign_op == v__token__Kind__assign || v__ast__Type_alias_eq(info.value_type, _const_v__ast__string_type)) { if (g->assign_op == v__token__Kind__assign || v__ast__Type_alias_eq(info.value_type, _const_v__ast__string_type)) {
@ -87486,12 +87519,12 @@ v__ast__Type v__parser__Parser_parse_map_type(v__parser__Parser* p) {
} }
v__parser__Parser_check(p, v__token__Kind__lsbr); v__parser__Parser_check(p, v__token__Kind__lsbr);
v__ast__Type key_type = v__parser__Parser_parse_type(p); v__ast__Type key_type = v__parser__Parser_parse_type(p);
v__ast__TypeSymbol* key_sym = v__ast__Table_sym(p->table, key_type);
bool is_alias = key_sym->kind == v__ast__Kind__alias;
if (v__ast__Type_idx(key_type) == 0) { if (v__ast__Type_idx(key_type) == 0) {
v__ast__Type _t2 = 0; v__ast__Type _t2 = 0;
return _t2; return _t2;
} }
v__ast__TypeSymbol* key_sym = v__ast__Table_sym(p->table, key_type);
bool is_alias = key_sym->kind == v__ast__Kind__alias;
bool key_type_supported = (key_type == _const_v__ast__string_type_idx || key_type == _const_v__ast__voidptr_type_idx) || (key_sym->kind == v__ast__Kind__enum_ || key_sym->kind == v__ast__Kind__placeholder || key_sym->kind == v__ast__Kind__any) || ((v__ast__Type_is_int(key_type) || v__ast__Type_is_float(key_type) || is_alias) && !v__ast__Type_is_ptr(key_type)); bool key_type_supported = (key_type == _const_v__ast__string_type_idx || key_type == _const_v__ast__voidptr_type_idx) || (key_sym->kind == v__ast__Kind__enum_ || key_sym->kind == v__ast__Kind__placeholder || key_sym->kind == v__ast__Kind__any) || ((v__ast__Type_is_int(key_type) || v__ast__Type_is_float(key_type) || is_alias) && !v__ast__Type_is_ptr(key_type));
if (!key_type_supported) { if (!key_type_supported) {
if (is_alias) { if (is_alias) {
@ -94027,7 +94060,8 @@ bool v__builder__Builder_print_warnings_and_errors_defer_0 = false;
} }
} }
if (redefines.len > 0) { if (redefines.len > 0) {
eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of function `"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); string ferror = v__util__formatted_error(_SLIT("builder error:"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of function `"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), _SLIT(""), ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,}));
eprintln(ferror);
for (int _t15 = 0; _t15 < redefines.len; ++_t15) { for (int _t15 = 0; _t15 < redefines.len; ++_t15) {
v__builder__FunctionRedefinition redefine = ((v__builder__FunctionRedefinition*)redefines.data)[_t15]; v__builder__FunctionRedefinition redefine = ((v__builder__FunctionRedefinition*)redefines.data)[_t15];
eprintln(v__util__formatted_error(_SLIT("conflicting declaration:"), redefine.fheader, redefine.fpath, redefine.f.pos)); eprintln(v__util__formatted_error(_SLIT("conflicting declaration:"), redefine.fheader, redefine.fpath, redefine.f.pos));