Merge branch 'master' into bill/rexcode

This commit is contained in:
gingerBill
2026-06-19 09:10:30 +01:00
6 changed files with 27 additions and 10 deletions

View File

@@ -3808,7 +3808,14 @@ gb_internal bool check_cast_internal(CheckerContext *c, Operand *x, Type *type)
gb_internal void check_cast(CheckerContext *c, Operand *x, Type *type, bool forbid_identical = false) {
if (!is_operand_value(*x)) {
ERROR_BLOCK();
error(x->expr, "Only values can be casted");
if (is_type_typeid(type)) {
gbString expr_str = expr_to_string(x->expr);
defer (gb_string_free(expr_str));
error_line("\tSuggestion: 'typeid_of(%s)'", expr_str);
}
x->mode = Addressing_Invalid;
return;
}

View File

@@ -2875,9 +2875,11 @@ gb_internal void collect_testing_procedures_of_package(Checker *c, AstPackage *p
InternedString interned = string_interner_insert(str_lit("Test_Signature"), 0, &hash);
Entity *test_signature = scope_lookup_current(testing_scope, interned, hash);
Scope *s = pkg->scope;
for (auto const &entry : s->elements) {
Entity *e = entry.value;
for_array(i, c->info.entities) {
Entity *e = c->info.entities[i];
if (e->pkg != pkg) {
continue;
}
if (e->kind != Entity_Procedure) {
continue;
}

View File

@@ -337,7 +337,10 @@ gb_internal ExactValue exact_value_float_from_string(String string) {
f64 f = bit_cast<f64>(u);
return exact_value_float(f);
} else {
GB_PANIC("Invalid hexadecimal float, expected 8 or 16 digits, got %td", digit_count);
// GB_PANIC("Invalid hexadecimal float, expected 4, 8, or 16 digits, got %td", digit_count);
// NOTE(bill): This should be caught by the tokenizer, so just pretend it's an f64
f64 f = bit_cast<f64>(u);
return exact_value_float(f);
}
}

View File

@@ -2043,7 +2043,8 @@ gb_internal bool lb_init_global_var(lbModule *m, lbProcedure *p, Entity *e, Ast
GB_ASSERT(!var.is_initialized);
Type *t = type_deref(var.var.type);
if (is_type_any(t)) {
// NOTE: 'any' literals or 'any's that point to other variables can be handled by the generic path
if (is_type_any(t) && !is_type_any(var.init.type) && init_expr->tav.mode != Addressing_Variable) {
// NOTE(bill): Edge case for 'any' type
Type *var_type = default_type(var.init.type);
gbString var_name = gb_string_make(permanent_allocator(), "__$global_any::");

View File

@@ -5043,9 +5043,15 @@ gb_internal isize check_is_assignable_to_using_subtype(Type *src, Type *dst, isi
return level+1;
}
}
isize nested_level = check_is_assignable_to_using_subtype(f->type, dst, level+1, src_is_ptr, allow_polymorphic);
if (nested_level > 0) {
return nested_level;
// Only follow the chain transitively when the field also has `using`, which is
// what the backend's lookup_subtype_polymorphic_selection requires (it gates
// recursion on EntityFlag_Using). A plain `#subtype`-only field enables a
// single-hop conversion but not a two-or-more hop transitive one.
if (f->flags & EntityFlag_Using) {
isize nested_level = check_is_assignable_to_using_subtype(f->type, dst, level+1, src_is_ptr, allow_polymorphic);
if (nested_level > 0) {
return nested_level;
}
}
}

View File

@@ -18,8 +18,6 @@ when ODIN_OS == .Windows {
@(export)
foreign import lib {
"system:curl",
"system:mbedx509",
"system:mbedcrypto",
"system:z",
"system:SystemConfiguration.framework",
}