From: Brendan Hansen Date: Thu, 23 Mar 2023 16:06:36 +0000 (-0500) Subject: bugfix: polymorphing with multi-pointing X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=6af6094c32646e0cb051da3b9b306fe7b4083360;p=onyx.git bugfix: polymorphing with multi-pointing --- diff --git a/compiler/src/polymorph.h b/compiler/src/polymorph.h index 78e443f4..7abab457 100644 --- a/compiler/src/polymorph.h +++ b/compiler/src/polymorph.h @@ -271,7 +271,7 @@ static PolySolveResult solve_poly_type(AstNode* target, AstType* type_expr, Type switch (elem.type_expr->kind) { case Ast_Kind_Pointer_Type: { - if (elem.actual->kind != Type_Kind_Pointer) break; + if (elem.actual->kind != Type_Kind_Pointer && elem.actual->kind != Type_Kind_MultiPointer) break; bh_arr_push(elem_queue, ((PolySolveElem) { .type_expr = ((AstPointerType *) elem.type_expr)->elem, diff --git a/core/runtime/info/helper.onyx b/core/runtime/info/helper.onyx index e063f1a0..ffa6c3fe 100644 --- a/core/runtime/info/helper.onyx +++ b/core/runtime/info/helper.onyx @@ -324,7 +324,7 @@ populate_struct_vtable :: (table: &$Table_Type, struct_type: type_expr, safe := if struct_method == null do continue; if safe && struct_method.type != member.type do continue; - dest := cast(&()->void) (cast(&u8) table + member.offset); + dest := cast(&()->void) (cast([&] u8) table + member.offset); *dest = *cast(&()->void) struct_method.data; } }