diff --git a/src/types.cpp b/src/types.cpp index 759f90ca6..66de402f8 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -3094,7 +3094,7 @@ gb_internal bool lookup_subtype_polymorphic_selection(Type *dst, Type *src, Sele return true; } } - if ((f->flags & EntityFlag_Using) != 0 && is_type_struct(f->type)) { + if ((f->flags & EntityFlags_IsSubtype) != 0 && is_type_struct(f->type)) { String name = lookup_subtype_polymorphic_field(dst, f->type); if (name.len > 0) { array_add(&sel->index, cast(i32)i); @@ -5030,11 +5030,7 @@ gb_internal isize check_is_assignable_to_using_subtype(Type *src, Type *dst, isi return level+1; } } - // 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) { + if (f->flags & EntityFlags_IsSubtype) { 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;