From: Brendan Hansen Date: Sat, 9 Jan 2021 16:02:04 +0000 (-0600) Subject: small bug fixes with polymorphic struct errors X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=9dcd0fbd4f507002e47fd02a4a4b49867e8b4821;p=onyx.git small bug fixes with polymorphic struct errors --- diff --git a/bin/onyx b/bin/onyx index 34b974eb..fa0aaae9 100755 Binary files a/bin/onyx and b/bin/onyx differ diff --git a/onyx.exe b/onyx.exe index 6b23601b..5f9676c7 100644 Binary files a/onyx.exe and b/onyx.exe differ diff --git a/src/onyxbuiltins.c b/src/onyxbuiltins.c index 2eb3edc8..e0960975 100644 --- a/src/onyxbuiltins.c +++ b/src/onyxbuiltins.c @@ -40,7 +40,7 @@ AstGlobal builtin_stack_top = { Ast_Kind_Global, Ast_Flag_Const | Ast_Flag_Glo // :TypeExprHack static OnyxToken type_expr_token = { Token_Type_Symbol, 9, "type_expr", { 0 } }; -AstNode type_expr_symbol = { Ast_Kind_Basic_Type, 0, &type_expr_token, NULL }; +AstNode type_expr_symbol = { Ast_Kind_Error, 0, &type_expr_token, NULL }; AstType *builtin_string_type; AstType *builtin_range_type; diff --git a/src/onyxutils.c b/src/onyxutils.c index 3912ffae..38e18d0b 100644 --- a/src/onyxutils.c +++ b/src/onyxutils.c @@ -896,6 +896,8 @@ AstStructType* polymorphic_struct_lookup(AstPolyStructType* ps_type, bh_arr(AstP i32 i = 0; bh_arr_each(AstPolySolution, sln, slns) { + sln->poly_sym = (AstNode *) &ps_type->poly_params[i]; + PolySolutionKind expected_kind = PSK_Undefined; if ((AstNode *) ps_type->poly_params[i].type_node == &type_expr_symbol) { expected_kind = PSK_Type; @@ -932,7 +934,6 @@ AstStructType* polymorphic_struct_lookup(AstPolyStructType* ps_type, bh_arr(AstP } } - sln->poly_sym = (AstNode *) &ps_type->poly_params[i]; i++; }